I was wondering if there is a way to access the "styleurl" tag of a placemark in a kml file from code. My requirement is that, I have multiple map backgrounds and I want to change the color of the elements being displayed on the map with a change in the map background. I have different types of elements like, MapPinPoints,MapPolyLines,MapPolygons on the map. Default Icons for
PinPoints and default line color for PolyLines are
configured as style elements in the kml file. And these styles are referenced in the placemarks as styleurls. Recently, we've added multiple map providers and I have to change the icons and line colors based on the background selected by the user and to achieve that, I guess, I've to access the styleurl of the placemark and edit it accordingly, but I didn't find a way. Here is a trimmed down version of one of my kml files.
<?xml version="1.0" encoding="utf-8"?>
I read this kml file using KMLReader and get the List of FrameworkElements. When I iterate through the list, I need to be able to access the "styleurl" tag of each item. Is there a way to retrieve that?