Open genlighten opened 9 years ago
look at the js code in this plnkr: http://plnkr.co/edit/VvAUnf2uMv38EpjXiBl7?p=preview
if (_.isEmpty(markers)){
handler.getMap().setZoom(12);
handler.getMap().setCenter({lat: -34, lng: 151});
}
else{
handler.bounds.extendWith(markers);
handler.fitMapToBounds();
}
I use gmaps on our site to display where our service providers are located in a given city, state or country. Sometimes users will search for an area where we don't have any service providers yet. In that case, I still want to display a properly-zoomed map of the respective location. When I have no markers to pass to handler.bounds.extendWith(markers), how can I set the lat/lon centroid and zoom level so I don't get a blank map?