Mark Points in coodinates

Apr 6, 2009 at 11:48 PM
Hi

How I can mark/remove points over the map in  determinates coordiantes in code?

Regards.
Alejandro
Apr 7, 2009 at 12:23 AM
Note: I need mark a latitude, longitude coordinates.
Developer
Apr 7, 2009 at 1:36 AM
this is the code from the prototype page.xaml.cs file
it has some examples
 
you make a GeometryLayer (yourlayer)
add it to the maps.Layers.Add(yourlayer)
the you can Add and Remove Geometry shapes on the layer
 
yourlayer.Add(xxx)
yourlayer.Remove(xxx)
 
 
 
            //Bermuda Triangle is drawn on a GeometryLayer with TransformUpdate
            GeometryLayer transformLayer = new GeometryLayer(map) { UpdateMode = GeometryLayer.UpdateModes.TransformUpdate };
            transformLayer.Opacity = 0.5;
            map.Layers.Add(transformLayer);
            Polygon polygon = new Polygon();
            transformLayer.Add(polygon);
            polygon.Points = new ObservableCollection<Point> { new Point(-80.195, 25.775), new Point(-64.75, 32.303), new Point(-66.073, 18.44) };
 
            RadialGradientBrush fillBrush = new RadialGradientBrush();
            fillBrush.GradientStops.Add(new GradientStop { Color = Colors.Red, Offset = 0 });
            fillBrush.GradientStops.Add(new GradientStop { Color = Colors.Purple, Offset = 1 });
            polygon.Fill = fillBrush;
            Color.FromArgb(0x7F, 0xFF, 0x00, 0x00);
            System.Windows.Controls.ToolTipService.SetToolTip(polygon, "Bermuda Triangle");
 
 
            //Equator is drawn on a PanOnly GeometryLayer
            GeometryLayer panOnlyLayer = new GeometryLayer(map) { UpdateMode = GeometryLayer.UpdateModes.PanOnlyUpdate };
            panOnlyLayer.Opacity = 0.5;
            map.Layers.Add(panOnlyLayer);
            LineString line = new LineString();
            panOnlyLayer.Add(line);
            line.Points.Add(new Point(-180, 0));
            line.Points.Add(new Point(180, 0));
            line.LineThickness = 4;
            line.LineColor = Colors.White;
            System.Windows.Controls.ToolTipService.SetToolTip(line, "Equator");
 
 
            //Equator endpoints are drawn on an ElementUpdate Geometry Layer to test synching of layers
            GeometryLayer elementUpdateLayer = new GeometryLayer(map) { UpdateMode = GeometryLayer.UpdateModes.ElementUpdate };
            elementUpdateLayer.Opacity = 0.5;
            map.Layers.Add(elementUpdateLayer);
            elementUpdateLayer.Add(new PointBase { Point = new Point(-180, 0) });
            elementUpdateLayer.Add(new PointBase { X = 180, Y = 0 }); // Alternative syntax for setting a PointBase
Apr 7, 2009 at 2:50 AM
Thanks for you quickly response

I'm only need mark a series of individual poins in my map, I modified the example as follows:

 

GeometryLayer transformLayer = new GeometryLayer(map) { UpdateMode = GeometryLayer.UpdateModes.TransformUpdate };

 

transformLayer.Opacity = 0.5;

map.Layers.Add(transformLayer);

DeepEarth.Geometry.

PointBase pointbase = new DeepEarth.Geometry.PointBase();

 

transformLayer.Add(pointbase);

pointbase.Point =

new Point(-58.3850, -34.6025);  //A point in a Buenos Aires City.

 

 

RadialGradientBrush fillBrush = new RadialGradientBrush();

 

fillBrush.GradientStops.Add(

new GradientStop { Color = Colors.Red, Offset = 0 });

 

fillBrush.GradientStops.Add(

new GradientStop { Color = Colors.Purple, Offset = 1 });

 

System.Windows.Controls.

ToolTipService.SetToolTip(pointbase, "-58.3850, -34.6025");

 

 

The question is: How I set the size of the point (I nee a litte circular point in every coordinate).

Thanks Again
Alejandro.

 
Developer
Apr 7, 2009 at 3:06 AM
you can create a style for your points
 
then apply the style to the point
 
a good example of this is the DevPin in the prototype
 
or also the drawing tools added in the latest source code use a style to change the appearance of the point
Developer
Apr 10, 2009 at 2:07 AM
Custom Pin code sample