Hello.
Is there a possibility to integrate generate POI and KML into the maps?
Example:
The app connects to a webservice and we get a KML file back.How can I display this file in the control?
Hello Jan,
Thank you for your post.
I have been investigating into this functionality you are looking to achieve, and after doing some research into KML, it appears that they are essentially just XML documents, and can be read into your application by using the XmlDocument class and its Load method. Each KML file that I had tested seemed to have a Placemark node, which had a Point node inside of it with the longitude and latitude points inside.
Using this information, I would suggest that you create a recursive loop that starts from the first element in the XmlDocument.DocumentElement.ChildNodes collection, and loops through each node and its children to find a node that has the name "Placemark." From there, you can continue parsing the KML file to find the Point node and its corresponding coordinate node, and create a Point that has its X and Y properties set to the longitude and latitude coordinates, respectively.
The XamGeographicMap supports a series type name GeographicSymbolSeries, which will draw a marker that you can write a template for at certain longitude and latitude points on the map. Using the procedure above, I would recommend that you create an IEnumerable<Point> and add each of the coordinate node points to this collection. Then, you can bind the GeographicSymbolSeries to this collection, and set its LongitudeMemberPath and LatitudeMemberPath to "X" and "Y", respectively to have your points drawn on the XamGeographicMap.
I have attached a sample project to demonstrate the above. Please note that the bin -> Debug folder currently contains the KML file that the ViewModel class will load and recursively parse.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
Thanks, this is working for me
I am glad the solution is working for you.
Please let us know if you have any more questions,
Regards,