Esempio n. 1
0
 protected void createGeometry(MapLayerBase layer, IGeometry geo)
 {
     if (geo is IPoint)
     {
         var point = (IPoint)geo;
         createPoint(point, layer);
     }
     if (geo is ILineString)
     {
         var lineString = (ILineString)geo;
         createPolyLine(lineString, layer);
     }
     if (geo is IPolygon)
     {
         var polygon = (IPolygon)geo;
         createPolygon(polygon, layer);
     }
     if (geo is IGeometryCollection)
     {
         var geometryCollection = (IGeometryCollection)geo;
         foreach (IGeometry subgeometry in geometryCollection.Geometries)
         {
             createGeometry(layer, subgeometry);
         }
     }
 }
Esempio n. 2
0
 public override void Activated(MapLayerBase modeLayer, MapLayerBase modeForegroundLayer)
 {
     if (TileLayer.TileSources.Count == 0)
     {
         UpdateView();
     }
     base.Activated(modeLayer, modeForegroundLayer);
 }
Esempio n. 3
0
        protected EnhancedMapPolygon createPolygon(IGeometry polygon, MapLayerBase layer)
        {
            var poly = new EnhancedMapPolygon
            {
                Locations     = CoordinateConvertor.CoordinatesToLocationCollection(polygon.Coordinates),
                GeometryStyle = StyleSpecification,
                Visibility    = Visibility
            };

            layer.AddChild(poly, CoordinateConvertor.ConvertBack(polygon.Centroid.Coordinate));
            mapObjects.Add(poly);
            return(poly);
        }
Esempio n. 4
0
        protected EnhancedMapPolyline createPolyLine(IGeometry lineString, MapLayerBase layer)
        {
            var line = new EnhancedMapPolyline
            {
                Locations     = CoordinateConvertor.CoordinatesToLocationCollection(lineString.Coordinates),
                GeometryStyle = StyleSpecification,
                Visibility    = Visibility
            };

            layer.AddChild(line, CoordinateConvertor.ConvertBack(lineString.Centroid.Coordinate));
            mapObjects.Add(line);
            return(line);
        }
Esempio n. 5
0
        protected EnhancedMapPoint createPoint(IGeometry point, MapLayerBase layer)
        {
            var location = CoordinateConvertor.ConvertBack(point.Coordinate);
            var mapPoint = new EnhancedMapPoint(location, mapInstance)
            {
                GeometryStyle = StyleSpecification
            };

            layer.AddChild(mapPoint, location);
            mapObjects.Add(mapPoint);
            mapPoint.Visibility = Visibility;
            return(mapPoint);
        }
Esempio n. 6
0
 protected EnhancedMapPolyline createPolyLine(IGeometry lineString, MapLayerBase layer)
 {
     var line = new EnhancedMapPolyline
     {
         Locations = CoordinateConvertor.CoordinatesToLocationCollection(lineString.Coordinates),
         GeometryStyle = StyleSpecification,
         Visibility = Visibility
     };
     layer.AddChild(line, CoordinateConvertor.ConvertBack(lineString.Centroid.Coordinate));
     mapObjects.Add(line);
     return line;
 }
Esempio n. 7
0
 protected EnhancedMapPolygon createPolygon(IGeometry polygon, MapLayerBase layer)
 {
     var poly = new EnhancedMapPolygon
     {
         Locations = CoordinateConvertor.CoordinatesToLocationCollection(polygon.Coordinates),
         GeometryStyle = StyleSpecification,
         Visibility = Visibility
     };
     layer.AddChild(poly, CoordinateConvertor.ConvertBack(polygon.Centroid.Coordinate));
     mapObjects.Add(poly);
     return poly;
 }
Esempio n. 8
0
 protected EnhancedMapPoint createPoint(IGeometry point, MapLayerBase layer)
 {
     var location = CoordinateConvertor.ConvertBack(point.Coordinate);
     var mapPoint = new EnhancedMapPoint(location, mapInstance) { GeometryStyle = StyleSpecification };
     layer.AddChild(mapPoint, location);
     mapObjects.Add(mapPoint);
     mapPoint.Visibility = Visibility;
     return mapPoint;
 }
Esempio n. 9
0
 protected void createGeometry(MapLayerBase layer, IGeometry geo)
 {
     if (geo is IPoint)
     {
         var point = (IPoint)geo;
         createPoint(point, layer);
     }
     if (geo is ILineString)
     {
         var lineString = (ILineString)geo;
         createPolyLine(lineString, layer);
     }
     if (geo is IPolygon)
     {
         var polygon = (IPolygon)geo;
         createPolygon(polygon, layer);
     }
     if (geo is IGeometryCollection)
     {
         var geometryCollection = (IGeometryCollection)geo;
         foreach (IGeometry subgeometry in geometryCollection.Geometries)
         {
             createGeometry(layer, subgeometry);
         }
     }
 }