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); } } }
public override void Activated(MapLayerBase modeLayer, MapLayerBase modeForegroundLayer) { if (TileLayer.TileSources.Count == 0) { UpdateView(); } base.Activated(modeLayer, modeForegroundLayer); }
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); }
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); }
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); }
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; }
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; }
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; }