Google Map from SQL Database

2020-04-21 04:28发布

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条回答
男人必须洒脱
2楼-- · 2020-04-21 04:49

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.

查看更多
登录 后发表回答