Question

I would like to color (fill and/or stroke) a country boundaries (boarders), say you have a world map and the user picked Italy, the boarders of italy will be stroked and the area of Italy will be filled with a color.

enter image description here

It would be very nice if the user can zoom and move the global map, but not a must. I am looking for something clean, dynamic , iOS5 friendly and easy to integrate, can be mapKit based or not.

I am aware that this can be done by KML files, but I am rather sure there is a library already out there - so there is no need of me reinventing fire, again.

Was it helpful?

Solution

I've done this, but it's a little tricky. You have to get all the coordinates for the boundary: i used this tool to get all the coordinates of my boudary, you have to use the polyline tool and each time you click on the map this tool generates all the coordinates on the right. Once you have all the coordinates, save them in some txt or klm file, then use MKOverlay class to draw the overlay based on the file's coordinates.

Hope it's clear, let me know if you want the snippet(i don't have my machine now).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top