I want to put a marker on a GMSMapView. But i don´t want that the marker will be displayed on ocean or see, only earth. I searched but i don´t find an attribute or method to detect if the surface on GMSMapView is see, ocean or earth. If there is propositions? I worked under XCode, and language Objective-C.
Do you need this to be global or is there a specific location you need?
You can use Google Maps Elevation layer to get if this location is above or below sea-level.
But some places have land that is below sea-level, so this solution would not always work.
https://developers.google.com/maps/documentation/elevation/intro
Related
I added two marks on Google maps. Now the two markers are overlapping. I want the selected marker to be always in the front. That means when you select a marker this marker covers another marker. I looked at the Google maps development documentation, which does not provide the relevant API.
How can I do this?
A simple resolution is using the propertie zIndex, just set to 1.
customMark.zIndex = 1
For more informations, you can see https://developers.google.com/maps/documentation/ios-sdk/reference/interface_g_m_s_marker
I am trying to enhance Google Maps bit deeper. I want to draw a curb line or you can say square on GMSMapview.
How ever I have tried to draw a lines using GMSPolygon. Lines are drawn as well but also want to get touch event when anyone wants to touch curb line I should get some event.
I am not sure at this moment that Google Maps will fulfil my requirements or not.
P.S : I have used google maps already in my app and now want to draw curb line(square) and should be notified when user tap on it and I should also have facility to clear that curb line from map.
You can user the delegate method mapView:didTapAtCoordinate to get the coordinate and then use the method GMSGeometryIsLocationOnPath or GMSGeometryIsLocationOnPathTolerance in the GMSGeometryUtils module
As an alternative, as long GMSPolygon is an GMSOverlay, you can use the delegate method mapView:didTapOverlay: to check if the coordinate lies on the path
I implement MKMapView in my application to draw a path between two place,i found all lat long between two point using google map API but it shows the path through road.
My problem is that i want to show the path in building,
For example:
I want to draw path between the gate1 to gate 2 of Building, i pass the "to and from" lat-long in to the google MAP API, it shows the path through road so it shows the wrong distance.
I tried the indoor map also but it works only in register buildings.
is there any way to determine which type of area you are in from a MKMapView? I.e. if the centre of the map is in the ocean we can tell the user: the centre of the map is above the ocean, or if the map is centred above a green area: the centre of the map is above parkland...
The only way I can think of to do this is to create a screenshot of the visible screen and analyse the colour of each bit by using some method such as this: iOS -- detect the color of a pixel?
However I would be interested to know if there is an easier way that anyone can think of!
EDIT
To make it more clear what I'm looking for, I'm basically looking for a way to turn a section of a map into a top down level for a game, with different areas determined by the areas of the map...
A CLPlacemark has a couple of properties: inlandWater and ocean which tell you when the placemark is in water. I think you can get a placemark from the geocoder.
It also has areasOfInterest which will give you parks and landmarks.
there is no foolproof way BUT CLGeocoder can reverse geocode a coordinate to an address and that would give you stuff like:
0/0 = ...., ocean
51/10 = ..., germany
-90/10 = ..... , united states
and so on
is there any way to determine which type of area you are in from a MKMapView? I.e. if the centre of the map is in the ocean we can tell the user: the centre of the map is above the ocean, or if the map is centred above a green area: the centre of the map is above parkland...
The only way I can think of to do this is to create a screenshot of the visible screen and analyse the colour of each bit by using some method such as this: iOS -- detect the color of a pixel?
However I would be interested to know if there is an easier way that anyone can think of!
EDIT
To make it more clear what I'm looking for, I'm basically looking for a way to turn a section of a map into a top down level for a game, with different areas determined by the areas of the map...
A CLPlacemark has a couple of properties: inlandWater and ocean which tell you when the placemark is in water. I think you can get a placemark from the geocoder.
It also has areasOfInterest which will give you parks and landmarks.
there is no foolproof way BUT CLGeocoder can reverse geocode a coordinate to an address and that would give you stuff like:
0/0 = ...., ocean
51/10 = ..., germany
-90/10 = ..... , united states
and so on