当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - Google Map - How to save location in DB?

问题描述:

I've recently started working on Google maps. Here is a sample html code:

<div id="locationContainer">

<input id="startPT" type="text" size="50"/>

<input id="wayPT" type="text" size="50"/>

<input id="endPT" type="text" size="50"/>

</div>

I have attached autocomplete feature on all the location input text fields

Now, I have two issues;

  1. How to save the location in a mySQL DB? I mean, should I save just the location on first fetching the coordinates and then save?
  2. Before saving to the DB, I want to validate that the location does exist in Google Maps.

    So that my system does not blindly save some xyz in DB.

Hope I've made my question understandable.

Thanks

网友答案:

1.saving the Latitude Longitude in 2 diffrent fields in the mysql database seems to be the best possibility.

2.the location exists in google maps if it exists in the world. this might give you an answer: http://answers.yahoo.com/question/index?qid=20071121075230AATuvo3

latitude has a minimum of -90 (south pole) and a maximum of 90 (north pole). 0 degrees latitude is the equator.

Longitude has a minimum of -180 (west of the prime meridian) and a maximum of 180 (east of the prime meridian). -180 and 180 are the same line, approached from opposite directions

good luck

分享给朋友:
您可能感兴趣的文章:
随机阅读: