Maps

Apps can use the Application Manager's launch or open methods to bring up the Map application (com.palm.app.maps) with a display showing the results of a query, the map view type, route, and zoom level. Use this for mapping to a specific location, the results of a local or business search, and even driving directions.

The open method takes a target parameter, and launch takes an id field and a params object.

The open method brings up the Maps application with an encoded URI that maps a location or directions to a location when supplied with the appropriate target string.

The launch method brings up the Maps application with a params object that includes queries and options for latitude, longitude, route, zoom, and map view type.

Parameters

Parameter Required Type Description
target Yes string A "mapto:location" or "maploc:location", where location is a well-formed location.
Required for "open" method.
id Yes string Set to "com.palm.app.maps". Required for "launch" method.
params No object See fields below. Optional for "launch" method.
location No object If specified, Map searches for "query" around this object's location.
lat No float Location's latitude in degrees. Valid range: -90.0, 90.0.
lng No float Location's longitude in degrees. Valid range: -180.0, 180.0.
query No string Contains information about a location, such as an address or landmark name, i.e., "1600 Pennsylvania Ave NW Washington, DC".
mapType No string The map view type.
  • aerial -- Aerial map style.
  • auto -- The best imagery for the current view is chosen.
  • birdseye -- Bird's eye map type.
  • collinsBart -- Collin's Bart (England/Great Britian) map type.
  • mercator -- Mercator style map.
  • ordnanceSurvey -- Ordnance Survey (England/Great Britian) map type.
  • road -- Road map style.
address No string Address location used to center the map view, i.e., "950 West Maude Avenue, Sunnyvale".
route No object Starting and ending route addresses.
startAddress No string Starting route address.
endAddress No string Ending route address.
zoom No string The zoom level value is 1-18, with 18 being the maximum zoom in.
Note: The maximum zoom level depends on the region. For some regions, zoom level 18 may not be available.

Examples

luna-send

luna-send -n 1   luna://com.palm.applicationManager/open '{"target": "mapto: 950 Maude Ave., 94085"}'
{ "processId": "success", "returnValue": true }
luna-send -n 1   luna://com.palm.applicationManager/launch '{"id":"com.palm.app.maps", "params":{"query":"Sunnyvale, CA"}}'
{ "processId": "success", "returnValue": true }
luna-send -n 1   luna://com.palm.applicationManager/launch '{"id":"com.palm.app.maps", "params": {"query":"1600 Pennsylvania Ave NW Washington, DC", "mapType": "aerial", "zoom": "16"}}'
{ "processId": "success", "returnValue": true }
luna-send -n 1 luna://com.palm.applicationManager/launch '{"id":"com.palm.app.maps", "params": { "route":{"startAddress":"1665 Sacramento St San Francisco CA", "endAddress": "950 Maude Avenue, Sunnyvale, CA"}, "mapType": "road", "zoom": "10"}}'
{ "processId": "success", "returnValue": true }

Enyo

. . . 
{
    name: "openMapCall",
    kind: "PalmService",
    service: "palm://com.palm.applicationManager/",
    method: "open",
    onSuccess: "openMapSuccess",
    onFailure: "openMapFailure",
    onResponse: "gotResponse",
    subscribe: true
},  
. . . 

openMapSuccess: function(inSender, inResponse) {
    enyo.log("Open map success, results=" + enyo.json.stringify(inResponse));
},
openMapFailure: function(inSender, inResponse) {
    enyo.log("Open map failure, results=" + enyo.json.stringify(inResponse));
},
openMap: function(inSender, inResponse)
{
    this.$.openMapCall.call({"target": "mapto: 950 Maude Ave., 94085"});
}   

Mojo open

this.controller.serviceRequest("palm://com.palm.applicationManager", {
    method: "open",
    parameters: {target: "mapto: 950 Maude Ave., 94085"}
});

Mojo launch

this.controller.serviceRequest("palm://com.palm.applicationManager", {
    method:"launch",
    parameters: {
        id: "com.palm.app.maps",
        params: {
            query: "White House, DC"
        }
    }
});
// Search for pizza around a specified location (lat, lng)
this.controller.serviceRequest("palm://com.palm.applicationManager", {
     method: "launch",
    parameters: {
            id: "com.palm.app.maps",
            params: {
                location: {lat: 37.759568992305134, lng: -122.39842414855957},
                query: "Pizza"
            }
    }
}); 

Sample Code

See Services Sample.