コード例 #1
0
 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;
 }
コード例 #2
0
 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;
 }
コード例 #3
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);
        }
コード例 #4
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;
 }