Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Can I use external javascript library in application

Hi.

I'm new to Titanium and I want to have a google maps shown on my app. I don't have problems to use it like that :

var webview = Titanium.UI.createWebView({url:'http://maps.google.com/maps?saddr=city1&daddr=city2'});
var window = Titanium.UI.createWindow();
window.add(webview);
window.open();

But my question is "is there a way to include google maps javascript API and use it like it's HTML page" ?

— asked November 26th 2010 by Dimitar Kalinov
  • external
  • google
  • javascript
  • maps
0 Comments

4 Answers

  • The javascripts for maps that google offers are DOM centric. In Ti DOM does not exists so no, you cannot. But you could use native map for a more efficient app :)

    — answered November 26th 2010 by Dan Tamas
    permalink
    0 Comments
  • I need to create routes between points on Google maps, so I guess that native map will not be much helpful for me.

    Thanks a lot for explaining me the situation.

    — answered November 26th 2010 by Dimitar Kalinov
    permalink
    0 Comments
  • Hi, you can create a map view with routes, check the KitchenSink example app on Base UI -> Views -> Map View with Routing

    — answered November 26th 2010 by Hernan Fernandez
    permalink
    0 Comments
  • OK, but what about the documentation here :

    http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Map.MapView-object

    addRoute :
    add a route. currently only supported on iphone

    Isn't it possible to add routes for android ?

    — answered November 29th 2010 by Dimitar Kalinov
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.