Sencha Touch - Marker on current location
I have added a marker to my current location. But because I used
centerchange I have to turn off draggable. Otherwise I get a lot of
markers everytime I'm dragging the map. Is there a other simple solution
to avoid that?
var refreshMap = function(themap) {
var marker = new google.maps.Marker({
position: themap.center,
title: 'Deine Position',
map: themap
})
}
map = new Ext.Map({
title: 'Map',
useCurrentLocation: true,
listeners: {
centerchange: function(comp, map){
refreshMap(map);
}
},
mapOptions: {
mapTypeId: google.maps.MapTypeId.ROADMAP,
center: new google.maps.LatLng(52.2799112, 8.0471788),
mapTypeControl: false,
zoomControl: true,
overviewMapControl: false,
panControl: false,
rotateControl: false,
scaleControl: false,
controlPosition: false,
navigationControl: false,
streetViewControl: false,
backgroundColor: 'transparent',
disableDoubleClickZoom: true,
zoom: 14,
draggable: false,
keyboardShortcuts: false,
scrollwheel: false
}
});
No comments:
Post a Comment