OSM to Google Maps polygons
I want to draw a city district area on Google Maps using Polygon class and an array of lat/lng coordinates. OpenStreetMap provides me all data I need — if I type some district name I can get useful data in OSM XML format, for example OSM drawn polygon of “Vecmilgravis” district in Riga, Latvia and it's data in OSM XML format . The problem is all those node nodes are sorted in some weird order, so if I just extract all lat and lng pairs and make an coordinates array for Google Maps Polygon class I see not what I've expected: Markers are displayed correctly 'cos coordinates order is not