Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
170
How do the xamMap coordinates work?
posted

Hey I've been messing around with the xamMap control for potential use in an upcoming project and I'm curious if I'm missing something about map coordinates. I was checking our the EarthQuakes example that Infragistics provided to sort of learn how the controls worked. As far as I know I have things set up correctly and created a couple "points" and attempted to add them to the map. For some reason they are not showing up. I'm not sure if its because of the coordinates I chose or what but I'm sorta confused.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

<StackPanel>

 

 

 

 

<igMaps:XamMap x:Name="myMap" IsClickable="False" MapProjectionType="Lambert" >

 

 

 

 

<igMaps:XamMap.Layers>

 

 

 

 

 

<igMaps:MapLayer x:Name="mapLayer">

 

 

 

 

<igMaps:MapLayer.Reader>

 

 

 

 

<igMaps:ShapeFileReader Uri="/../ClientBin/Shapefiles/usa_st">

 

 

 

 

</igMaps:ShapeFileReader>

 

 

 

 

</igMaps:MapLayer.Reader>

 

 

 

 

</igMaps:MapLayer>

 

 

 

 

 

<igMaps:MapLayer x:Name="symbolLayer">

 

 

 

 

<igMaps:MapLayer.ValueTemplate>

 

 

 

 

<DataTemplate>

 

 

 

 

<Image Source="Resources/marker.png" Height="50" Width="50" />

 

 

 

 

</DataTemplate>

 

 

 

 

</igMaps:MapLayer.ValueTemplate>

 

 

 

 

</igMaps:MapLayer>

 

 

 

 

 

</igMaps:XamMap.Layers>

 

 

 

 

</igMaps:XamMap>

</StackPanel>

 

 

private void AddMapElements()

{

 

 

if (_vm.Spots != null)

{

 

 

MapElementCollection elementCollection = new MapElementCollection();

 

 

foreach (SpotViewModel location in _vm.Spots)

{

 

 

Point coordinates = new Point(location.Longitude, location.Latitude);

 

 

Point origin = myMap.MapProjection.ProjectToMap(coordinates);

 

 

SymbolElement mapElement = new SymbolElement

{

ToolTip = location,

SymbolOrigin = origin,

SymbolType =

 

MapSymbolType.Diamond

};

elementCollection.Add(mapElement);

}

myMap.Layers[

 

"symbolLayer"].Elements = elementCollection;

}

}

 

 

 

 

 

 

 

private void GetEarthQuakeData()

{

 

 

 

List<SpotViewModel> spotData = new List<SpotViewModel>

{

 

 

 

new SpotViewModel(new SpotData("1", "Location 1", DateTime.Now, 0, 0, "Somewhere")),

 

 

 

new SpotViewModel(new SpotData("2", "Location 2", DateTime.Now, 100.0, 200.0, "Another Place"))

this is basically all I got going on besides some constructors that call all this and some getters and setters of data.

Any help would be awesome.