iOS Map Kit может отображать аннотации, тогда может содержать такие места, как направления.
сплава Контроллер: index.js
var MapModule = require('ti.map');
var opera = MapModule.createAnnotation({
latitude: -33.8569,
longitude: 151.2153,
centerOffset: {x: 80, y: 25},
image: 'SydneyOperaHouse.jpg',
title: 'Sydney Opera House',
subtitle: 'Sydney, New South Wales, Australia',
// For eventing, use the Map View's click event
// and monitor the clicksource property for 'rightButton'.
rightButton: Ti.UI.iPhone.SystemButton.CONTACT_ADD
});
var bridge = MapModule.createAnnotation({
latitude: -33.852222,
longitude: 151.210556,
pincolor: MapModule.ANNOTATION_PURPLE,
title: 'Sydney Harbour Bridge',
subtitle: 'Port Jackson',
// For eventing, use the Map View's click event
// and monitor the clicksource property for 'leftButton'.
leftButton: Ti.UI.iPhone.SystemButton.INFO_DARK
});
var mapview = MapModule.createView({
mapType: MapModule.NORMAL_TYPE,
region: {latitude: -33.87365, longitude: 151.20689, latitudeDelta: 0.1, longitudeDelta: 0.1 },
annotations: [bridge,opera]
});
$.index.add(mapview);
$.index.open();
Не fortget включить этот модуль в вашем Tiapp.xml т.е.
<modules>
<!-- Add this line to your modules section -->
<module platform="iphone">ti.map</module>
</modules>
Спасибо Эдуардо. Я обновил свой вопрос, чтобы уточнить, что мне нужно построить маршрут по дорогам от А до Б. –
Добавить [маршрут] (http://docs.appcelerator.com/platform/latest/#!/api/Modules .Map.Route-property-points), устанавливая точки вверх. Это должно построить дорогу –
При необходимости тип файла CSV может хранить точки, чтобы включить MapView с маршрутизацией. Демо: https://github.com/appcelerator/titanium_mobile/blob/master/demos/KitchenSink/Resources/examples/map_view2.js#L28 –