I have latitude/lognitude variables that are not strings and I need to put them into JavaScript variables. I currently try to do something like this which does not work:
lat = <?= $objkey->lat ?>;
lng = <?= $objkey->lng ?>;
But wrapping it in strings, breaks the maps functions when I use the lat/lng variables.
What is the right way to go about this?
Here is the URL where this is happening: http://www.comehike.com/outdoors/parks/trailhead.php
It’s not outputting anything from PHP.
In your code:
lat = ;Resulting in a
Uncaught SyntaxError: Unexpected token ;