I have a clunky-architecture question 🙂
I have 1 php script. The script performs a database query for longitude/latitude from the database, and gets that data. Then what I need it to do is call JavaScript function which places a marker on the spot of the lat/lng.
Is that possible to accomplish? How is such a thing best done?
Thanks,
Alex
A simplest way to pass value from php to javascript is to simply create a variable inside
scripttag on your page.Then, where you initialize the map, you can also create a marker. Something like this
You can check Google Maps Javascript API documentation for more information.