Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Highlighted
Developer
Posts: 37
Registered: ‎10-20-2010
My Device: 9550
My Carrier: VZW

Load Dynamic KML to Google Maps

What I want to do is build a KML file based on input from the user via a PHP file.  I am already doing this now successfully with BlackBerry maps.  However, it is not working so well with Google Maps.   Below is some sample code of what is working and not working....

 

This works just fine for passing to Blackberry maps

 

 

String KMLurl = "http://www.website.com/kml.php?loc=xyz";
MapsArguments ma = new MapsArguments(MapsArguments.ARG_KML, KMLurl);
Invoke.invokeApplication(Invoke.APP_TYPE_MAPS, ma);

 

 

This doesn't work when passing to google maps

 

String KMLurl = "http://www.website.com/kml.php?loc=xyz";
int module = CodeModuleManager.getModuleHandle("GoogleMaps");
String[] args = {KMLurl}; 
ApplicationDescriptor descriptor = CodeModuleManager.getApplicationDescriptors(module)[0];
ApplicationDescriptor ad2 = new ApplicationDescriptor(descriptor, args);
ApplicationManager.getApplicationManager().runApplication(ad2, true);

 

If i pass the "http://www.website.com/kml.php?loc=xyz" into a web browser, save the KML output from that, and upload it to the website as "http://www.website.com/map.kml", it works as follows.

String KMLurl = "http://www.website.com/map.kml";
int module = CodeModuleManager.getModuleHandle("GoogleMaps");
String[] args = {KMLurl}; 
ApplicationDescriptor descriptor = CodeModuleManager.getApplicationDescriptors(module)[0];
ApplicationDescriptor ad2 = new ApplicationDescriptor(descriptor, args);
ApplicationManager.getApplicationManager().runApplication(ad2, true);

 

Any clues as to why I can't pass the "dynamic" kml file to google maps?