payprop / html-googlemaps-v3

Fork of HTML::GoogleMaps to fix issues
2 stars 1 forks source link

onload_render: improve handling when nothing to render #22

Closed nigelhorne closed 5 years ago

nigelhorne commented 5 years ago

If all of your add_marker() calls fail, or if you call it before adding points, onload_render() returns illegal JS.

myCenterLatLng = new google.maps.LatLng({lat: , lng: }); // key map controls var map = new google.maps.Map(document.getElementById('map'), { mapTypeId: google.maps.MapTypeId.NORMAL, scrollwheel: false, zoom: 13, draggable: true });

It's illegal because lat: is empty.

It would help if it either errored, returned a empty value for $head, or fixed the JS somehow.

leejo commented 5 years ago

@nigelhorne - I'll try to have a look today, unless you're already working on a fix?

nigelhorne commented 5 years ago

@leejo I'm not yet, I wanted to log the issus before I forgot about it. I can do one if you're prefer.

leejo commented 5 years ago

@nigelhorne - if you could, given you've got a working example of this bug

nigelhorne commented 5 years ago

Will do!