iOS Detect Touch on Custom Map Image to Select Irregular Shaped Region - ios

I have a png image of a country's map showing its regions.
I want to detect touch and select (uniquely identify) any irregular shaped region from map and perform some activity for selected region. I also want to show/display selection of region while tapping on it (either by highlighting region's image or showing a line on his boundary).
Please tell me the best way to achieve this. MKMapView won't help as i don't want to use Apple/Google maps.

Related

UIButton with a custom asymmetric clickable region?

I have an image with various asymmetric regions, is it possible to place a button above each region?
The image will be something similar to this: https://cdn.dribbble.com/users/1557638/screenshots/4367307/proactive_d.png
After way too much research, I’ve decided to go with following solution for an image with multiple asymmetric clickable regions:
Duplicated the image file, colored each region with a different color, and stored as an asset.
Placed a simple tap gesture recognition over the displayed image. When tapped, I get the relative coordinate to the displayed image.
Get the color from the map image at the tapped coordinates.
Compare to a predefined enum.

Custom map drawing ios

I want to modify IOS MKMapView such that I want all continents to be of my own colour such as green colour and I want to include only continents in map (water area should be hidden or transparent). Also when I tap on particular region, then I should be able to retrieve the latitude and longitude after customising ( mainly focussing on fetching country info only ). Please suggest me any methods to implement this.
Thank You.

Maps on iOS: Drawing layers without showing the base map

We are looking for a drawing / mapping SDK for iOS with the following requirements:
Draw multiple polygons on a single view. polygon coordinates are based on earth lat/long
Do not show other map layers from satellite / street view / whatever - just the polygon data
Allow adding layers / text/ bubbles / etc.
Allow zoom in-out
Allow clicking on regions.
Calculate bounding rect automatically, and do not allow the user to scroll out of this area.
Is there an SDK that supports these requirements?
Thanks.
Check out the Mapbox iOS SDK. It's open source, allows you to hide the basemap (or create a custom basemap to whatever appearance you desire), constrain the panning and zooming, add vector polygons atop the baselayer(s), add text and labels, control interactivity, and more.

Fill image with different color by detecting the different parts

I have an Image of a landscape which i need to fill with different colors.
When i select colors from palette and start scrubbing on any particular part, only that part should get the color even if by mistake i take my finger outside of that image part.
So basically i need to detect which part of image have i tapped so that only that part takes the color.
I am developing this app in Cocos2dx, but any help in logic would be a good point to start.
Here is an example of what i want.
Note : I know i could achieve this by taking separate images and then detecting touches, but that increases the app size by alot of MB's.
I guess user will be able to draw only on white part of the image.
If above is true, what i want you to do is, in your touchesMoved method, check if any black color (non white) pixel is present between previous touch point and current touch point.
If there is no such black pixel, then draw it else dont draw it.

Is it possible to construct an irregularly shaped button that would be an overlay on a map?

The idea is as follows: the view contains a map (can be a zoomable image), map is divided into regions, each region is touchable and takes you to a more detailed view (not a map).
I'm not asking for solutions I'm asking for a general direction, of course if something like this is possible at all.
You have to create transparent images and change hittest method to not account for transparent region. For details see this link.
You can also see this project in github.

Resources