Beispiel #1
0
        public override GOFeature ParseFeatureData(VectorTileFeature feature, GOLayer layer)
        {
            IDictionary properties = feature.GetProperties();
            GOFeature   goFeature;

            if (layer.layerType == GOLayer.GOLayerType.Roads)
            {
                goFeature = new GORoadFeature();
            }
            else
            {
                goFeature = new GOFeature();
            }

            goFeature.kind = GOEnumUtils.MapboxToKind(layer.name);

            goFeature.y = layer.defaultLayerY();
            if (properties.Contains("_symbol"))
            {
                goFeature.y = Convert.ToInt64(properties ["_symbol"]) / 10.0f * Global.tilesizeRank;
            }

            goFeature.height = layer.defaultRendering.polygonHeight;

            return(goFeature);
        }
Beispiel #2
0
        public override GOFeature EditFeatureData(GOFeature goFeature)
        {
            IDictionary properties = goFeature.properties;

            if (goFeature.goFeatureType == GOFeatureType.Point)
            {
                goFeature.name = (string)goFeature.properties ["name"];
                return(goFeature);
            }
            else
            {
                goFeature.name = goFeature.layer.name;
            }

            goFeature.kind = GOEnumUtils.MapboxToKind(goFeature.layer.name);
            goFeature.setRenderingOptions();

            goFeature.y = goFeature.layer.defaultLayerY();
            if (properties.Contains("_symbol"))
            {
                goFeature.y = Convert.ToInt64(properties ["_symbol"]) / 15.0f;
            }

//			float fraction = 20f;
//			goFeature.y = (1 + goFeature.layerIndex + goFeature.featureIndex/goFeature.featureCount)/fraction;

            goFeature.height = goFeature.layer.defaultRendering.polygonHeight;

            return(goFeature);
        }
        public override GOFeature EditFeatureData(GOFeature goFeature)
        {
            IDictionary properties = goFeature.properties;

            if (goFeature.goFeatureType == GOFeatureType.Point)
            {
                goFeature.name = (string)goFeature.properties ["name"];
                return(goFeature);
            }

            if (goFeature.layer != null && goFeature.layer.layerType == GOLayer.GOLayerType.Roads)
            {
                ((GORoadFeature)goFeature).isBridge = properties.Contains("brunnel") && (string)properties ["brunnel"] == "bridge";
                ((GORoadFeature)goFeature).isTunnel = properties.Contains("brunnel") && (string)properties ["brunnel"] == "tunnel";
                ((GORoadFeature)goFeature).isLink   = properties.Contains("brunnel") && (string)properties ["brunnel"] == "link";
            }

            goFeature.kind = GOEnumUtils.MapboxToKind((string)properties["class"]);

//			goFeature.y = goFeature.featureIndex/1000 + goFeature.layer.defaultLayerY();
//			if (goFeature.kind == GOFeatureKind.lake) //terrible fix for vector maps without a sort value.
//				goFeature.y = GOLayer.defaultLayerY (GOLayer.GOLayerType.Landuse)+0.1f;

            float fraction = 20f;

            goFeature.y = (1 + goFeature.layerIndex + goFeature.featureIndex / goFeature.featureCount) / fraction;
            if (goFeature.kind == GOFeatureKind.lake)             //terrible fix for vector maps without a sort value.
            {
                goFeature.y += 0.5f;
            }

            goFeature.setRenderingOptions();
            goFeature.height = goFeature.renderingOptions.polygonHeight;

            if (goFeature.layer.useRealHeight && properties.Contains("render_height"))
            {
                double h = Convert.ToDouble(properties["render_height"]);
                goFeature.height = (float)h;
            }

            if (goFeature.layer.useRealHeight && properties.Contains("render_min_height"))
            {
                double hm = Convert.ToDouble(properties["render_min_height"]);
                goFeature.y = (float)hm;
                if (goFeature.height >= hm)
                {
                    goFeature.y      = (float)hm;
                    goFeature.height = (float)goFeature.height - (float)hm;
                }
            }


            if (goFeature.layer.forceMinHeight && goFeature.height < goFeature.renderingOptions.polygonHeight && goFeature.y < 0.5f)
            {
                goFeature.height = goFeature.renderingOptions.polygonHeight;
            }

            return(goFeature);
        }
Beispiel #4
0
        public override GOFeature EditLabelData(GOFeature goFeature)
        {
            IDictionary properties = goFeature.properties;

            goFeature.name = (string)goFeature.properties ["name"];
            goFeature.kind = GOEnumUtils.MapboxToKind((string)properties["class"]);

            goFeature.y = goFeature.getLayerDefaultY();

            return(goFeature);
        }
        public override GOFeature EditFeatureData(GOFeature goFeature)
        {
            if (goFeature.goFeatureType == GOFeatureType.Point)
            {
                goFeature.name = (string)goFeature.properties ["name"];
                return(goFeature);
            }

            IDictionary properties = goFeature.properties;

            if (goFeature.layer != null && goFeature.layer.layerType == GOLayer.GOLayerType.Roads)
            {
                ((GORoadFeature)goFeature).isBridge = properties.Contains("structure") && (string)properties ["structure"] == "bridge";
                ((GORoadFeature)goFeature).isTunnel = properties.Contains("structure") && (string)properties ["structure"] == "tunnel";
                ((GORoadFeature)goFeature).isLink   = properties.Contains("structure") && (string)properties ["structure"] == "link";
            }

            goFeature.kind = GOEnumUtils.MapboxToKind((string)properties["class"]);

            goFeature.name = (string)properties ["class"];

//			goFeature.y = (goFeature.index / 50.0f) + goFeature.getLayerDefaultY() /150.0f;
//			float fraction = goFeature.layer.layerType == GOLayer.GOLayerType.Buildings? 100f:10f;
            float fraction = 20f;

            goFeature.y = (1 + goFeature.layerIndex + goFeature.featureIndex / goFeature.featureCount) / fraction;

            goFeature.setRenderingOptions();
            goFeature.height = goFeature.renderingOptions.polygonHeight;

            bool extrude = properties.Contains("extrude") && (string)properties["extrude"] == "true";

            if (goFeature.layer.useRealHeight && properties.Contains("height") && extrude)
            {
                double h = Convert.ToDouble(properties["height"]);
                goFeature.height = (float)h;
            }

            if (goFeature.layer.useRealHeight && properties.Contains("min_height") && extrude)
            {
                double minHeight = Convert.ToDouble(properties["min_height"]);
                goFeature.y      = (float)minHeight;
                goFeature.height = (float)goFeature.height - (float)minHeight;
            }

            if (goFeature.height < goFeature.layer.defaultRendering.polygonHeight && goFeature.y == 0)
            {
                goFeature.height = goFeature.layer.defaultRendering.polygonHeight;
            }

            return(goFeature);
        }
Beispiel #6
0
        public override GOFeature EditLabelData(GOFeature goFeature)
        {
            goFeature.name = (string)goFeature.properties ["_name_global"];
            goFeature.kind = GOEnumUtils.MapboxToKind(goFeature.labelsLayer.name);
            goFeature.y    = goFeature.getLayerDefaultY() + 1;

//			if (properties.Contains ("_symbol"))
//				goFeature.y = Convert.ToInt64 (properties ["_symbol"]) / 10.0f;



            return(goFeature);
        }
        public override GOFeature ParseFeatureData(VectorTileFeature feature, GOLayer layer)
        {
            IDictionary properties = feature.GetProperties();
            GOFeature   goFeature;

            if (layer.layerType == GOLayer.GOLayerType.Roads)
            {
                goFeature = new GORoadFeature();
                ((GORoadFeature)goFeature).isBridge = properties.Contains("brunnel") && (string)properties ["brunnel"] == "bridge";
                ((GORoadFeature)goFeature).isTunnel = properties.Contains("brunnel") && (string)properties ["brunnel"] == "tunnel";
                ((GORoadFeature)goFeature).isLink   = properties.Contains("brunnel") && (string)properties ["brunnel"] == "link";
            }
            else
            {
                goFeature = new GOFeature();
            }

            goFeature.kind = GOEnumUtils.MapboxToKind((string)properties["class"]);

            goFeature.y = goFeature.index / 1000 + layer.defaultLayerY();

            if (goFeature.kind == GOFeatureKind.lake)             //terrible fix for vector maps without a sort value.
            {
                goFeature.y = layer.defaultLayerY(GOLayer.GOLayerType.Landuse);
            }

            goFeature.height = layer.defaultRendering.polygonHeight;

            if (layer.useRealHeight && properties.Contains("render_height"))
            {
                double h = Convert.ToDouble(properties["render_height"]);
                goFeature.height = (float)h;
            }

            if (layer.useRealHeight && properties.Contains("render_min_height"))
            {
                double hm = Convert.ToDouble(properties["render_min_height"]);
                goFeature.y = (float)hm;
                if (goFeature.height >= hm)
                {
                    goFeature.y      = (float)hm;
                    goFeature.height = (float)goFeature.height - (float)hm;
                }
            }

            return(goFeature);
        }
        public override GOFeature EditLabelData(GOFeature goFeature)
        {
            string labelKey = goFeature.labelsLayer.LanguageKey(goFeature.goTile.mapType);

            if (goFeature.properties.Contains(labelKey) && !string.IsNullOrEmpty((string)goFeature.properties [labelKey]))
            {
                goFeature.name = (string)goFeature.properties [labelKey];
            }
            else
            {
                goFeature.name = (string)goFeature.properties ["name"];
            }

            goFeature.kind = GOEnumUtils.MapboxToKind(goFeature.labelsLayer.name);
            goFeature.y    = goFeature.getLayerDefaultY() + 1;

            return(goFeature);
        }
Beispiel #9
0
        public override GOFeature EditFeatureData(GOFeature goFeature)
        {
            IDictionary properties = goFeature.properties;

            if (goFeature.goFeatureType == GOFeatureType.Point)
            {
                goFeature.name = (string)goFeature.properties ["name"];
                return(goFeature);
            }

            goFeature.kind = GOEnumUtils.MapboxToKind(goFeature.layer.name);

            goFeature.y = goFeature.layer.defaultLayerY();
            if (properties.Contains("_symbol"))
            {
                goFeature.y = Convert.ToInt64(properties ["_symbol"]) / 10.0f;
            }

            goFeature.height = goFeature.layer.defaultRendering.polygonHeight;

            return(goFeature);
        }