Google Map from SQL Database

扶醉桌前 提交于 2019-12-02 10:44:50

问题


I have a set of coordinates in a database that I want to be used to add markers on a google map. How would I go about doing this? I have my code set up to look like:

http://www.macrostash.com/2011/09/17/demo-use-a-php-mysql-database-to-load-markers-on-a-google-map/

and the database set up the same way. However the example isn't working well. I am fairly new to this so any help would be appreciated. Thanks


回答1:


That's a good tutorial! I got it to work using sourcecode links from the broken demo site. Handy, and I've been looking for a source like this.

You need to organize your datatable fieldnames just exactly as the script requires, and also detail the proper js, namely jquery-1.6.2.min.js and jquery-ui-1.8.14.custom.min.js. Since the latter is custom jquery code, you can't just find any file named jquery-ui-1.8.14.custom.min.js and use it, you have to use the custom code, and I have linked to it below.

jquery-1.6.2.min.js (vanilla, but here is the link): http://www.macrostash.com/wp-content/plugins/jquery-1.6.2.min.js

jquery-ui-1.8.14.custom.min.js http://www.macrostash.com/wp-content/plugins/jquery-ui-1.8.14.custom.min.js

download the above files and then upload them to a js directory on your server. After that, update your html to read:

<script type='text/javascript' src='js/jquery-1.6.2.min.js'></script>
<script type='text/javascript' src='js/jquery-ui-1.8.14.custom.min.js'></script>

Should work after that.



来源:https://stackoverflow.com/questions/16884035/google-map-from-sql-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!