The best of Magic Earth for every iOS and Android app
Help your app users perform searches, navigate and view a specific location using Magic Earth URL schemes. No matter whether they are online or offline.
Launch Magic Earth and perform a specific action
To launch Magic Earth and perform one of the supported actions, use a URL scheme:
magicearth://?parameters
Display a map
Use this URL scheme to display the map at a specified zoom level and location. You can also choose to display different map modes (standard, satellite, terrain and hybrid).
Parameters | Meaning | Observation |
---|---|---|
open_map | Open Map view | |
lat | Latitude | |
lon | Longitude | |
name | Name for POI | |
str | Street name | |
no | Number | |
zip | Zip code | |
sett | Settlement | |
city | City | |
cnty | County | |
state | State | |
ctry | Country | |
zoom | Zoom level (value between 32 and 115) | |
map mode | The map type: • standard • satellite • terrain • hybrid (terrain + satellite) |
Search
Use this scheme to display search queries in a specified viewport location.
Parameters | Meaning | Observation |
---|---|---|
show_on_map | Present location on the map | * |
q | Search query | |
what_is_nearby | Provides nearby POIs around current position | * |
search_around | Open Search view having current position as reference search point | * |
open_search | Open Search view |
* Latitude and longitude fields are mandatory.
Navigate
Use this scheme to display directions between two locations and to navigate to a specific location. You can also specify the transportation mode.
Parameters | Meaning | Observation |
---|---|---|
get_directions | Open Directions view | * |
drive_to | Start car navigation from current position | * |
drive_via | Add intermediate waypoint to the active car route | * |
walk_to | Start pedestrian navigation from current position | * |
walk_via | Add intermediate waypoint to the active pedestrian route | * |
bike_to | Start bike navigation from current position | * |
bike_via | Add intermediate waypoint to the active bike route | * |
public_transport_to | Start public transport navigation from current position | * |
navigate_home | Start navigation to home favourites | * |
navigate_work | Start navigation to work favourites | * |
saddr | Source address (departure) | |
daddr | Destination address |
* Latitude and longitude fields are mandatory.
Show weather
Use the below parameter to display the weather data for a location. Weather forecast is available for 14 days.
Parameters | Meaning | Observation |
---|---|---|
show_weather | Opens Weather view | * |
* Latitude and longitude fields are mandatory.
Save location
Use one of the below parameters to save a specific location in your app.
Parameters | Meaning | Observation |
---|---|---|
add_to_favorites | Add location to favourites category | * |
save_as_home | Save location as home favourites | * |
save_as_work | Save location as work favourites | * |
save_as_contact | Open Save as Contact view | * |
* Latitude and longitude fields are mandatory.
Send location
Use the below parameters to share your current location.
Parameters | Meaning | Observation |
---|---|---|
send | Open Share my location view |
Parameters | Meaning | Observation |
---|---|---|
open_map | Open Map view. | |
show_on_map | Present location on the map. | * |
q | Search query. | |
what_is_nearby | Provides nearby POIs around current position. | * |
search_around | Open Search view having current position as reference search point. | * |
open_search | Open Search view. | |
get_directions | Open Directions view. | * |
drive_to | Start car navigation from current position. | * |
drive_via | Add intermediate waypoint to the active car route. | * |
walk_to | Start pedestrian navigation from current position. | * |
walk_via | Add intermediate waypoint to the active pedestrian route. | * |
bike_to | Start bike navigation from current position. | * |
bike_via | Add intermediate waypoint to the active bike route. | * |
public_transport_to | Start public transport navigation from current position. | * |
navigate_home | Start navigation to home favourites. | * |
navigate_work | Start navigation to work favourites. | * |
add_to_favorites | Add location to favourites category. | * |
save_as_home | Save location as home favourites. | * |
save_as_work | Save location as work favourites. | * |
show_weather | Open Weathers view. | * |
send | Open Share my location view. | |
lat | Latitude. | |
lon | Longitude. | |
name | Name for POI. | |
str | Street name. | |
no | Number. | |
zip | Zip code. | |
sett | Settlement | |
city | City. | |
cnty | County. | |
state | State. | |
ctry | Country. | |
saddr | Source address (departure). | |
daddr | Destination address. | |
zoom | Zoom level (value between 32 and 115) | |
madmode | The map type: • standard • satellite • terrain • hybrid (terrain + satellite) |
* Latitude and longitude fields are mandatory.
Examples:
Show Paris on the standard map. | magicearth://?q=Paris&mapmode=standard |
Navigate to CH1 6BJ United Kingdom. | magicearth://?daddr=CH1+6BJ+United+Kingdom |
Drive to latitude=48.85649 and longitude=2.35216. | magicearth://?drive_to&lat=48.85649&lon=2.35216. |
The following code snippet example will navigate to latitude and longitude if Magic Earth is installed or will launch the AppStore to install Magic Earth:
func navigateTo(latitude:Double, longitude:Double)
{
let urlScheme = NSURL(string:"magicearth://")
if UIApplication.sharedApplication().canOpenURL(urlScheme!)
{
let string = String(format: "magicearth://?drive_to&lat=%f&lon=%f", arguments: [latitude, longitude])
let urlRoute = NSURL(string: string)
// Launch Magic Earth and start navigation.
UIApplication.sharedApplication().openURL(urlRoute!)
}
else
{
let urlStore = NSURL(string:"https://itunes.apple.com/app/id1007331679")
// Magic Earth is not installed. Launch AppStore.
UIApplication.sharedApplication().openURL(urlStore!)
}
}
Feature comparison:
Functionality | Magic Earth | Apple Maps | Google Maps |
---|---|---|---|
Navigation (by car) | x | x | x |
Navigation (by foot) | x | x | x |
Navigation (by bike) | x | x | |
Navigation (by transit) | x | x | x |
Navigation to Home | x | x | x |
Navigation to Work | x | x | x |
Navigation intermediate waypoint | x | x | |
Map type: standard, satellite | x | x | x |
Map type: terrain | x | x | |
Map type: transit | x | ||
Map type: streetview | x | ||
Zoom level | x | x | x |
Search location | x | x | x |
Mark location as Home | x | x | x |
Mark location as Work | x | x | x |
Mark location as favorite | x | x | x |