I have a Google map where I can put a marker, drag it and with it goes a circle that is the search radius.
My problem is that if I click inside the radio it does not call me to the event that makes the marker move to the position of the pointer, since the radius is above it.
What can I do to make the circle look but not affect the clicks?
var pos = {
lat: latitud,
lng: longitud
};
map = new google.maps.Map(document.getElementById('map'), {
center: pos,
zoom: 6
});
marcador = new google.maps.Marker({
map: map,
draggable: true,
animation: google.maps.Animation.DROP
});
marcador.addListener('click', toggleBounce);
centerMarkerMap();
circulo = new google.maps.Circle({
strokeColor: '#44a373',
strokeOpacity: 0.5,
strokeWeight: 1,
fillColor: '#44a373',
fillOpacity: 0.25,
map: map
});
circulo.setRadius(parseInt(inpRadius.value) * 1000);
circulo.bindTo('center', marcador, 'position');
//Evento del mapa que crea los marcadores al hacer click
google.maps.event.addListener(map, 'click', function (event) {
marcador.setMap(null);
circulo.setMap(null);
marcador = new google.maps.Marker({
map: map,
draggable: true,
position: event.latLng,
animation: google.maps.Animation.DROP
});
marcador.addListener('click', toggleBounce);
estandarizarPos(event.latLng);
google.maps.event.addListener(marcador, 'dragend', function () {
estandarizarPos(marcador.getPosition());
});
circulo = new google.maps.Circle({
strokeColor: '#44a373',
strokeOpacity: 0.5,
strokeWeight: 1,
fillColor: '#44a373',
fillOpacity: 0.25,
map: map
});
circulo.setRadius(parseInt(inpRadius.value) * 1000);
circulo.bindTo('center', marcador, 'position');
});
google.maps.event.addListener(marcador, 'dragend', function () {
estandarizarPos(marcador.getPosition());
});