public InfoGeometry(IGeometry geometry, StyleSpecification styleSpecification, MapCore map, EnhancedMapLayer layer) : base(geometry, styleSpecification, map, layer) { //must have at least one EnhancedMapPoint to show label and launch balloon. foreach (var mapObject in mapObjects) { if (mapObject is EnhancedMapPoint) { var mapPoint = (EnhancedMapPoint)mapObject; if (mainPoint == null) { mainPoint = mapPoint; } mapPoint.Balloon += (o, e) => Balloon(this, new BalloonEventArgs { LayerID = layer.ID, ItemID = ItemID }); } } if (mainPoint == null) { //TODO: create one, invisible at centre of first object var point = geometry.Centroid; mainPoint = createPoint(point, layer); mainPoint.Balloon += (o, e) => Balloon(this, new BalloonEventArgs { LayerID = layer.ID, ItemID = ItemID }); } Selected += InfoGeometry_Selected; }
public BaseGeometry(IGeometry geometry, StyleSpecification styleSpecification, MapCore map, EnhancedMapLayer layer) { Geometry = geometry; StyleSpecification = styleSpecification; mapInstance = map; mapLayer = layer; mapObjects = new ObservableCollection<Control>(); if (mapLayer != null) { createGeometry(mapLayer, Geometry); } }
public SelectGeometry(IGeometry geometry, StyleSpecification styleSpecification, MapCore map, EnhancedMapLayer layer) : base(geometry, styleSpecification, map, layer) { //default is the inverse of the style colours + 50% larger icon. SelectedSpecification = styleSpecification.Clone(); SelectedSpecification.IconScale = styleSpecification.IconScale * 1.5; SelectedSpecification.LineColour = Utilities.InvertColorFromHexString(styleSpecification.LineColour); SelectedSpecification.PolyFillColour = Utilities.InvertColorFromHexString(styleSpecification.PolyFillColour); foreach (Control mapObject in mapObjects) { mapObject.MouseLeftButtonDown += SelectGeometry_MouseLeftButtonDown; mapObject.MouseEnter += SelectGeometry_MouseEnter; mapObject.MouseLeave += SelectGeometry_MouseLeave; } mapObjects.CollectionChanged += mapObjects_CollectionChanged; EnableSelection = true; }
private void setStyleOnMapObjects(StyleSpecification styleSpecification) { foreach (Control mapObject in mapObjects) { if (mapObject is EnhancedMapPoint) { ((EnhancedMapPoint)mapObject).GeometryStyle = styleSpecification; } if (mapObject is EnhancedMapPolyline) { ((EnhancedMapPolyline)mapObject).GeometryStyle = styleSpecification; } if (mapObject is EnhancedMapPolygon) { ((EnhancedMapPolygon)mapObject).GeometryStyle = styleSpecification; } } }
public StyleChangedEventArgs(StyleSpecification oldStyle, StyleSpecification newStyle) { this.oldStyle = oldStyle; this.newStyle = newStyle; }