titanium-mapbox
titanium-mapbox copied to clipboard
[Bug] setCenterLatLng is wrong
The location is right (here I use user location to be sure), but the map is not centered.
var mapbox = require('com.polancomedia.mapbox');
var mapView;
Titanium.Geolocation.getCurrentPosition(function(e){
mapView = mapbox.createView({
id: 'mapview',
map: 'XXXXXXXXXXX',
minZoom: 6, //8,
maxZoom: 18, //10,
zoom: 16,
centerLatLng: [e.coords.latitude,e.coords.longitude],
width: Ti.UI.FILL,
height: Ti.UI.FILL,
hideAttribution: true, //defaults to: false. See Mapbox terms and conditions before removing
debugTiles:false,
userLocation: true
});
$.index.add(mapView);
$.index.open();
});
That's a strange one, thanks for posting. I worked on items similar to this in the past, and it was working properly in 0.2, but now is back in 0.4. I've got an idea what may be at issue. I'll see what I can do in the next day or two.
FYI, I removed the map id from your code example.