How do I create a mapview with titanium appcelerator mobile?

Janusz picture Janusz · Jun 10, 2010 · Viewed 7.6k times · Source

I just start to work with appcelerator and I haven't found a good layout tutorial yet. At the moment I try to show a mapview with a specific location. Has anybody an example or a good pointer on how to do this?

Answer

jhaynie picture jhaynie · Jun 27, 2010

Download the KitchenSink which is mentioned on the Getting Started page. It has several hundred examples on how to use the various Titanium based APIs - including MapViews.

Here's a simple example

    var mapview = Titanium.Map.createView({
    mapType: Titanium.Map.STANDARD_TYPE,
    region:{latitude:33.74511, longitude:-84.38993, latitudeDelta:0.5, longitudeDelta:0.5},
    animate:true,
    regionFit:true,
    userLocation:true
});
win.add(mapview);