Reputation: 5935
I am implementing application which involves showing multiple locations in a google map in blackberry...
Can anybody provide me a hint ???
Upvotes: 0
Views: 700
Reputation: 420
for implementing multiple location on Google map first you need create a kml file example :-
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Placemark>
<name>Ottawa</name>
<description>Ottawa office</description>
<Point>
<coordinates>-90.86948943473118,48.25450093195546,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Battel Creek</name>
<description>Battel Creek</description>
<Point>
<coordinates>-85.1220703125,42.35042512243457,0</coordinates>
</Point>
</Placemark>
</Document>
</kml>
save this file on a server (Extension should be KML) and set that path in the code below:-
public void invokeGMaps() {
int mh = CodeModuleManager.getModuleHandle("GoogleMaps");
if (mh == 0) {
try {
throw new ApplicationManagerException(
"GoogleMaps isn't installed");
} catch (ApplicationManagerException e) {
System.out.println(e.getMessage());
}
}
String[] args = { };//PUT THE SAVED FILE URL OVER HERE IN DOUBLE QUOTES
ApplicationDescriptor ad = CodeModuleManager
.getApplicationDescriptors(mh)[0];
ApplicationDescriptor ad2 = new ApplicationDescriptor(ad, args);
try {
ApplicationManager.getApplicationManager()
.runApplication(ad2, true);
} catch (ApplicationManagerException e) {
System.out.println(e.getMessage());
}
}
You need to install google map before implementing these code. you can download google map from here :- m.google.com/maps
Upvotes: 1