This project has moved. For the latest updates, please go here.

MapPath Location

Mar 18, 2015 at 11:30 AM
Edited Mar 18, 2015 at 11:32 AM
Hi Clemens,

Great work ! This control is amazing !

I can't figure out how to find correct coordinates for a MapPath. Here is your sample :
 <map:MapPath Stroke="Blue" Fill="Aqua" Opacity="0.5">
    <map:MapPath.Data>
        <GeometryGroup FillRule="EvenOdd">
            <EllipseGeometry Center="8.2,63.5" RadiusX="0.025" RadiusY="0.025"/>
             <EllipseGeometry Center="8.2,63.51" RadiusX="0.015" RadiusY="0.015"/>
        </GeometryGroup>
    </map:MapPath.Data>
</map:MapPath>
How to calculate the 63.51 part ? (8.2 seems to be the longitude, and 63.51 the latitude, but multiplied by a factor)

EDIT : i assume this factor affects Radius-es, too ?

Thx a lot,

Nicolas
Coordinator
Mar 18, 2015 at 11:48 AM
As mentioned in the code comment in class MapPath, the geometry is given in projected coordinates (also referred to as cartesian map coordinates). You get them from a Location by the MapTransform transformation in class MapBase, which is an instance of class MercatorTransform. You could also just call the static method MercatorTransform.LatitudeToY to get a projected y value of 63.5 from a latitude of 53.4613.

I guess I'll have to add a comment to the sample application's XAML.
Mar 18, 2015 at 11:55 AM
Thank you for your quick response. I feel so stupid about not reading your very explicit comment >.>

Yeah, adding a comment to the sample application is a good idea to avoid stupid questions like this one ;)