javascript - google.maps.LatLng is not a function -


all. building web app google map. working fine until decided add autocomplete feature address box. original javascript include was:

everything working fine. once added autocomplete feature, saw had change javascript include to:

<script src="https://maps.googleapis.com/maps/api/js?signed_in=true&libraries=places&callback=initautocomplete" async defer></script> 

the autocomplete works, older map code broken. specifically, error:

typeerror: google.maps.latlng not function

i everywhere have following code:

var googleposition = new google.maps.latlng(lat, lng); 

from tests, can tell has portion after javascript include.

signed_in=true&libraries=places&callback=initautocomplete async defer 

any ideas how can both of these features working together?

thanks!

yes, rid off async defer attributes.

then have @ this: https://developer.mozilla.org/en/docs/web/html/element/script

async set boolean attribute indicate browser should, if possible, execute script asynchronously. has no effect on inline scripts (i.e., scripts don't have src attribute).

defer boolean attribute set indicate browser script meant executed after document has been parsed. since feature hasn't yet been implemented other major browsers, authors should not assume script’s execution deferred. defer attribute shouldn't used on scripts don't have src attribute. since gecko 1.9.2, defer attribute ignored on scripts don't have src attribute. however, in gecko 1.9.1 inline scripts deferred if defer attribute set.


Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -