About Geometry Layers

Apr 4, 2009 at 12:16 AM
Edited Apr 4, 2009 at 12:59 AM
Hi, thanks for answering my previous questions.
I have read the API.
Seemed like X and Y cooridinates are only exposed to "DevPin.cs"

Is there anyways at runtime, i can check all the Pins Latitude and Longitude in a specified PinLayer ?
Developer
Apr 4, 2009 at 1:07 AM
A pin has a "Point" Property
 
if you look at the DevPin class you will see it inherits PointBase class
 
public class DevPin : PointBase

so you can get the coords from the Point Property
 
Examples from Page.cs in Prototype project
 
            //Add an arrow pin whose another point is an anchor of 0.5, 1.0;
            var point = new Point(0, 0);
            var arrowPin = new PointBase { Point = point, Style = styleArrow };
            anchorTestLayer.Add(arrowPin);
 
 
            //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 4, 2009 at 2:09 AM
Thanks .netnoobie!!
i got the point by using
((DeepEarth.Geometry.
PointBase)((Marker)layer.Children[i])).Point.X;