I am writing an iPhone application that uses google maps SDK to display a city. I need to add multiple markers on the map to identify certain locations.
I could loop through and add each marker upon the map load, but I don't believe this is a efficient technique(it seems very unnecessarily and resource heavy!!)?
Or is there some "Lazy loading" technique I could use to pull in the markers that are currently in view?
For that you can add it in map region wise, you have to add marker only for current displaying map region, but for this also you need to run loop.
So you can avoid other markers that would added to map.
Related
I am developing an App that shows a map with annotations. The annotations are in thousands and growing. There are data associated with the annotation pins. I get the data from web service. Should I download all the data for all the pins upfront? That obviously is bad. But how should I do it in an efficient way that when the user zooms in and out the map, there is no lag.
Thanks in advance!
Show pins according particular region zoom, instead of showing all pins at one time.
I am building an iOS map with local search functionality similar to Yelp.
The user will see a local map generated from Google Maps SDK from iOS, and local points of interest returned by the search, will be displayed on the map as custom markers. Simultaneously, the user can also see these same local search results in a list form on another screen.
My issue is as follows: to optimize loading time, I would like the app to load only the search results within the area displayed by the map, given the coordinates of the center of the map, and the zoom level. This would be more efficient than loading, say, all search results within a 30 km radius, most of which may not be visible on the map. Is there a simple way to know exactly what are the coordinates of the area displayed by the map on the user's phone (bottom left corner, top right corner)?
I have seen other posts online, explaining how the coordinates of the area can be calculated using zoom level, latitude, and screen resolution. However I am wondering if there is a simpler way commonly used by other apps that display local points of interest.
Thank you!
I am stuck with some lack of xcode / iOS programming knowledge.
I have created a track in google maps for iOS, and programmatically created markers along this track. What I would like to do is update these markers with actual information in the .title / .snippet (ie. distance to go, time to go etc) or remove them all together.
But when you create markers in a loop there is no way of keeping track of them.
since the amount of markers can vary from 2 to 50 it would be strange in my opinion to create 50 different variables for each marker, I guess there must be another way?
You can keeping track of created markers.
Each GMSMarker has property userData. You can add some string tag or other custom object to identify this marker.
e.g.
marker.userData = #{#"key" : #"some tag"};
I am working on iOS Application which requires offline map feature.
When I am trying to fetch markers in offline mode it displaying no image for any marker
even it is not calling method
[self asyncLoadMarkerIconURL:(NSURL *)markerURL point:point];
As it is only call if data successfully retrieve from URL
and so it is not update marker array for display markers.
So is there any solution to display markers as I created on my map box project in offline map (without internet)?
Two possible solutions. Mapbox marker imagery is requested from online, which is why you are seeing this behavior.
First have an internet connection so that the marker imagery is cached for later offline use.
The other approach is to manually fetch the marker imagery ahead of time to bundle with your app. Here is the section where marker URLs are formed based on desired size, color, and imagery:
https://github.com/mapbox/mbxmapkit/blob/d87e1465d196a9948381919da0c1eb8d72a242bf/MBXMapKit/MBXRasterTileOverlay.m#L124
See also standalone markers at https://www.mapbox.com/developers/api/static/.
I want to create an app for ipad with custom map (very small pice of global map, like a google map), which have my design, but with same geo attributes as google map (for example). Can you advise me something?
I think it could be useful to take a look at Google Maps - Overlays