titanium-mapbox icon indicating copy to clipboard operation
titanium-mapbox copied to clipboard

[Bug] setCenterLatLng is wrong

Open micromalice opened this issue 10 years ago • 1 comments

The location is right (here I use user location to be sure), but the map is not centered.

img_0426

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();
});

micromalice avatar Jun 13 '14 11:06 micromalice

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.

adampax avatar Jun 13 '14 17:06 adampax