How to put my own map in MKMapView - ios

I need create an app for iOS using the GPS and MapKit. The idea is create my own map of my house for example and add it to the UIView or MKMapView and see the current position into the map.
see the image

You can use custom overlay on the map. Here is nice example of image overlay on the mapView.

Apple has provided sample code to do this with map tiles. Using the MapKnitter website you can geoposition your floor plan and export it in a format that Apple's code will accept.

Related

Can we add the custom view or the pulse ring animation around the marker in google maps

I have to add a pulse ring animation around a marker. As I see there is only NSObject in GOOGLEMAPS so we cannot add up a view . I have also tried to change or animate the scale of the marker but the scale change did not happen. Can anybody help me with this thing?
I've worked quite a bit with clustering markers with Google Maps for iOS SDK. GMSMapView uses OpenGL to render the markers on the map corresponding to the data points added via GMSMarkers. They provide a basic pop animation on appearance, but nothing else.
Without tracking GMSMarker movements and adding/keeping track of your own UIViews on the GMSMapView, this doesn't seem possible. GMSMarker lets the user specify a UIImage to replace the default marker image, but not animate the rendered UIImage, as the GMSMapView is backed by OpenGL. It is quite limiting- clustering markers was difficult because you cannot replace the default GMSMarker image with just a UIView. It HAS to be a UIImage.

mbtiles: Is it possible to draw some lines on offline mbtiles map

I have an .mbtiles file and I am using it for offline map (iOS MapBox SDK). But my .mbtiles doesn't have enough data (just simple green rectangle). I want to draw some lines(roads) between points (I download it from my rest API). I found the solution to use RMShape, but I want to use already drawn map. I create my .mbtiles from osm and TileMill. Help me out please.
WhirlyGlobe-Maply SDK can help you achieve this.
It has a mapview and a globe view which you implement on your viewcontroller.
Then you create a layer using your mbtile file as shown below:
let tileSource = MaplyMBTileSource(mbTiles: "your-mbtile-filename")
You add this layer on the globe or map to display the tiles.
And using SDK's function like addShapes(), you can add, circles, vectors, labels, text and icons on the map/globe.
I tried adding lat and long lines programatically. Also tried adding some labels and spheres.
This is how it looks ->
WhirlyGlobe-Maply using mbtile and drawing on top of it

How to show indoor annotations on MKMapView

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.

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.

Drawing a circle on MapView with specifiec radius on Monondroid

I'm trying to draw a circle with specific radius in km (for example 2km) on a MapView at specific lat/lng. I've found some samples:
Creating Custom Overlay on the map
Draw A Circle On Android MapView
Draw circle of certain radius on map view in android
I think first and second of above are useful but these are in Java and I need code for Mono for Android (Monodevelop).
I can't find Projection class in monodroid.
And can't use com.google.android.maps.Projection.
Can somebody help me how to use these codes in monodroid?
com.google.android.maps.Projection is an interface, so it is made available in Mono for Android as Android.GoogleMaps.IProjection to keep with normal C# conventions.
Similarly, where you'd use mapView.getProjection() in Java, in C# it is made available via the Projection property on MapView.
Xamarin has some tutorials on their site that go over how to use these to create custom overlays, so I'd suggest checking them out.

Resources