I have been searching for this topic but I dont see any article discussing about checking if google maps embed has a marker. I have data from the database that is dynamically inserted to the params of embed map. Im asking about this because some data inserted in the embed maps only shows the world map not the exact location and no marker. Any possible ways to check if it has a marker or not?
Asked
Active
Viewed 220 times
0
-
I think this [SO thread](http://stackoverflow.com/questions/6100514/google-maps-v3-check-if-marker-is-present-on-map) might offer some insight. – ReyAnthonyRenacia Jul 22 '16 at 01:41
1 Answers
0
Do you not need to set the location and marker using the API and say e.g. data-widget...
API docs: google.Maps reference
We have something like;
// Map instance
state.map = new google.maps.Map(el, {
center: state.latLngObj,
zoom: state.zoom,
maxZoom: 18,
mapTypeControl: false,
panControl: false,
streetViewControl: false,
scrollwheel: !data.disableScroll,
draggable: mapDraggable,
zoomControl: true,
zoomControlOptions: {
style: google.maps.ZoomControlStyle.SMALL
},
mapTypeId: state.style
});
state.marker.setMap(state.map);

Mazaz
- 108
- 3