Blackberry: Passing KML file to Google Maps

Posted by Pria on Stack Overflow See other posts from Stack Overflow or by Pria
Published on 2010-05-17T11:08:29Z Indexed on 2010/05/17 11:10 UTC
Read the original article Hit count: 261

Filed under:
|
|

I want to know that can I pass KML as a string to google map application?

Code snippet:

//KML String
 String document = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><kml xmlns=\"http://www.opengis.net/kml/2.2\"><Document><Folder><name>Paths</name><open>0</open><Placemark><LineString><tessellate>1</tessellate><coordinates> -112.0814237830345,36.10677870477137,0 -112.0870267752693,36.0905099328766,0</coordinates></LineString></Placemark></Folder></Document></kml>";

//Invoke Google Maps

int module = CodeModuleManager.getModuleHandle("GoogleMaps");

if (module == 0) {
  try {
    throw new ApplicationManagerException("GoogleMaps isn't installed");
  } catch (ApplicationManagerException e) {
    System.out.println(e.getMessage());
  } 
}

String[] args = {document}; //Is this possible???
ApplicationDescriptor descriptor = CodeModuleManager.getApplicationDescriptors(module)[0];
ApplicationDescriptor ad2 = new ApplicationDescriptor(descriptor, args);
try {
     ApplicationManager.getApplicationManager().runApplication(ad2, true);
    } catch (ApplicationManagerException e) {
      System.out.println(e.getMessage());
 }

© Stack Overflow or respective owner

Related posts about blackberry

Related posts about google-maps