I have been trying to add a logic where by when you start dragging the map around the marker will stay in the center of the map and then return the lat and lng of the new position. Please see the Plunker of what I have done thanks Plunker
var location = {lat: -33.8830, lng: 151.2166};
var mainMarker = {
lat: location.lat,
lng: location.lng,
focus: true,
draggable: false
};
var vm = angular.extend(this, {
center: {
lat: location.lat,
lng: location.lng,
zoom: 17
},
markers: {
mainMarker: angular.copy(mainMarker)
},
defaults: {
zoomControl: false
},
tiles: {
url: 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'
}
});
The marker position could be updated (centered on the map) when map moves like this:
Updated plunker