Link to home
Start Free TrialLog in
Avatar of ank5
ank5Flag for India

asked on

Launch apple maps (with markers) from ionic

I am working on an ionic app which needs to run on iPhone/iPad.

From the ionic app, users will select some addresses and they want the Apple maps to be launched with the markers set on those addresses.

Additional challenge here is that most of the users using the app won't have internet connectivity at the place of work. So, the markers need to be displayed even when there is no internet.

Is this possible to achieve this?
ASKER CERTIFIED SOLUTION
Avatar of Eoin OSullivan
Eoin OSullivan
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ank5

ASKER

Thanks for the detailed reply.

NO INTERNET CONNECTION
Apple Maps and Google Maps on iOS has a certain caching of map data but without internet connectivity you cannot load a map from anywhere .. in effect both Map apps will store the information from the immediate area when there is connectivity and that is still available when offline.

However if you send locations for New York and you're in Colorado and offline the map data will not be on the device and it will not work.  In effect you need some internet connectivity for maps to work properly.

In case I have downloaded the Offline Google Maps on my device, can't that be used to load the markers when the device is offline?
If you're pre-downloaded the maps concerned in Google Maps of course they will be available OFFLINE.

Offline caching of map data is possible in Google Maps app (and even works a bit better than Apple Maps)

However if you don't know where in the world/country/state the markers will be located you cannot cache the entire state or country in Google or Apple Maps so it is only a partial solution and assumes that the users will already know and have cached the maps for the areas your markers are located.

If this is a bespoke app for a pre-defined set of users and you can instruct them to load particular map areas in Google or Apple Maps then it can work of course.
Avatar of ank5

ASKER

The maps will be restricted to a particular area, so we are good there. I have downloaded the offline maps on iPad.

The challenge here is how to load a specific location in the (offline) Google maps from Ionic application.

The below Ionic code allows me to launch Google maps app (online version)

<a href="comgooglemaps://?q=dallas" data-rel="external">iOS launch in google maps</a>

Open in new window


but when the device if offline this does not load the correct location, so I am assuming it's not using the downloaded offline Google maps.
This question is veering off topic as we are now getting into Google Maps app on iOS not Apple Maps.

Apple Maps on iOS 9 only appears to support ONE marker when you use it as an external URL link.
This may change in iOS 10 but at present I believe this is the limit.

When using URLs can you use the latitude, longitude and NOT a location which will probably need online access to convert an address into a grid reference.

If you imagine that the Apple Maps or Google Maps has a cached map database of 50 square miles .. if you simply pass a street address it will need online access to work out where in the world it is located.
Whereas if you pass a latitude/longitude the app can instantly tell if the location is included in the cached data and display a marker.
I'm not clear how much address information is cached along with the map data but I'd expect it to be relatively basic and definitely not a full zipcode or address based lookup