How to show indoor annotations on MKMapView - ios

I need to show an indoor floor plan in a MKMapView. So far I have managed to load custom map tiles into MKMapView. But when I try to show annotations it does not show in correct location. The space between latitudes are not equal. I think it’s because MKMapView maps the globe into flat surface. But in my case I need to show annotations in a flat surface. Any idea how to do this?
EDIT : Anyone know how to convert geographic coordinates to cartesian coordinates? That will solve this problem

Apple just updated its demo project:
https://developer.apple.com/library/prerelease/ios/samplecode/footprint/Introduction/Intro.html
Take a look, there are information about how to translate geolocation (spherical) to flat location.

Related

iPhone Xcode PDF MAP location GPS

I have a PDF map. What's the easiest way, to add a GPS "blue dot" with my location. Somehow to sync it with maps & add this PDF as a layer on top of that? Thanks
Here's a post on rendering a PDF to PNG. How to convert PDF to PNG efficiently?
You'll need to know the GPS coordinates at the top left and bottom right of the image that produces.
You can try creating an MKOverlay containing the image and define its MKMapRect based on those known coordinates.
If that doesn't work for some reason, you could use MKMapView's convert(_:toPointTo:) to tell you where those GPS coordinates are on a UIView that you manage yourself. (Heads up: that's more complicated than it seems)

Display annotations for 3D model object on iOS

Please suggest me a solution for displaying annotations (text or images) for 3D model object on iOS.
For details, so far, I'm able to load and display an 3D model object on iOS by following the guide at http://iosdeveloperzone.com/2016/05/10/getting-started-with-modelio/. But I cannot find a way to add annotations, then display them with the 3D model object. I expect the implementation on iOS will be similar with https://sketchfab.com/models/363e92268ff04a6ba8322332004bdaab (on web version).
Thank you for any suggestions and answers.
Project the locations of your 3D locations into screen space. Then use the overlaySKScene to draw the annotations. This will get the annotations in the right spot, and keep the text a constant size, independent of the distance from the camera to each annotation's location.
You can try to create node with SCNText geometry type. This allows to show text in 3D scene.

Place pin randomly on road - iOS Maps Swift

I'm trying to figure out how I can place an annotation randomly on a road.
I can randomly position an annotation onto a map, but I would like this annotation to be on a road and not in a shopping mall/building/home etc.
Does anyone know the best way I can do this?
One strategy would be to take your random coordinate and then reverse geocode it. That will provide an address closest to your random coordinate. Once reverse geocoded, you can use the result of that process to create your annotation.

Draw a grid onto an MKMapView

I'd like to draw a grid into my map, that represents the size of a tile at a certain zoom level. So for example I'd like to have a grid on my mapview that shows the outline of a zoom level 10 tile. So the outline of where this tile would be. No matter if the mapview itself is at zoom level 5 or 15, it should display the outline of where that tile would be placed.
The problem I have is how to calculate the proper rect that represents each visible "tile".
Any help is sooo much appreciated!!!
Or maybe the answer to following question would help:
How can I convert a MKMapRect to a MKTileOverlayPath?
I find that MapKit is way too limited when you want to start doing more and more with maps.
I would reccomend using Google Maps SDK for iOS: https://developers.google.com/maps/documentation/ios/start
and then using GMSTileLayer for the tiles:
https://developers.google.com/maps/documentation/ios/reference/interface_g_m_s_tile_layer
In the long run, replacing MapKit with Google maps gives you far more features and options and has better geolocation and reverse geolocation than Apple
You can also look at Mapbox. Between using TileMill to create a grid layer by setting the Map background to a pattern image, you could then only export zoom level 10 and either host it on Mapbox or export it to MBTiles format (SQLite-based). Then one of the Mapbox mobile toolkits could serve the tiles out as an overlay on your map.

Simple marker clustering on apple map

Hello I want to do Pin point's clustering on apple map. What is the possible solutions of it.Now the apple map with one pin point is display on my screen. What is the code after it for Pin point's grouping. Thanks in advance
A possible (and successful, I'm using it at work) solution for clustering/displaying lots of points on a map is
http://robots.thoughtbot.com/how-to-handle-large-amounts-of-data-on-maps

Resources