Developers: Use MapTool to display multiple spots on a map

Just a small how-to for WebOS developers to use the free MapTool app to display several spots on a map. You can sublaunch MapTool from your app and give it a parameter set with a description of the spots you want to show.

MapTool is available from the AppCatalog and the Homebrew repository on Precentral.net. In the time of writing the most current published version is 1.0.1 and is available from Precentral.net. There is a 1.0.2 already submitted to Palm but still pending since a week.

Have a look into the launch parameters and a working example after the break:

The launch parameter is an array of such a struct:

name : the name of the spot
lat : latitude
lon : longitude
image : an optional image url
id : id from geocaching.com

in the future I will add an url parameter for any url associated with this spot. It will also support tracks in the near future.

Look at this example from TravelGuide:


case "do-map":
var params = [];
for (var i=0; i
params.push({
lat: this.kEntries[i].lat.replace(/,/g, "."),
lon: this.kEntries[i].lng.replace(/,/g, "."),
name: this.kEntries[i].title
});
}
this.controller.serviceRequest("palm://com.palm.applicationManager", {
method: "open",
parameters: {
id: 'de.metaviewsoft.maptool',
params: params
},
onFailure: function() {
var currentScene = this.controller.stageController.activeScene();
currentScene.showAlertDialog({title: $L("No MapTool installed"),
onChoose: function(value) {
if (value == "INSTALL") {
this.controller.serviceRequest("palm://com.palm.applicationManager", {
method: "open",
parameters: {
id: 'com.palm.app.browser',
params: {target: "http://developer.palm.com/appredirect/?packageid=de.metaviewsoft.maptool"}
}
});
}
}.bind(this),
message: $L("Please install the free MapTool application from the AppCatalog"),
choices: [{label:$L('Install'), value:"INSTALL"},
{label:$L('Continue'), value:"CLOSE"}]
});
}.bind(this)
});
break;

And now to something completely different: If you need a German translation for your English WebOS app, just send me an email. Price is 10$ for 100 words as a basis for negotiation.

BTW: how can I insert formatted code into wordpress?

März 27, 2010 · admin · No Comments
Posted in: Allgemein, Developing, Palm, WintecTool