How to connect PHP / MySQL with Google MAPs-Create Table Session


To build a GPS vehicle tracking using the PHP / MySQL with Google MAP. You must do after preparing the hardware and software requirements are connect PHP / MySQL with Google MAP. The first step in the connection process PHP / MySQL with Google Map is Create Table. As an example we will create a table that contains markers id, name, address, lat, lng, type.
You can use the phpMyAdmin interface makes this table or can use the manual method. For the information of code.google.com, when you create the MySQL table, you want to pay particular attention to the lat and lng attributes. With the current zoom capabilities of Google Maps, you should only need 6 digits of precision after the decimal. To keep the storage space required for our table at a minimum, you can specify that the lat and lng attributes are floats of size (10,6). That will let the fields store 6 digits after the decimal, plus up to 4 digits before the decimal, e.g. -123.456789 degrees. Your table should also have an id attribute to serve as the primary key.
Note: This tutorial uses location data that already have latitude and longitude information needed to plot corresponding markers. If you're trying to use your own data that don't yet have that information, use a batch geocoding service to convert the addresses into latitudes/longitudes. Some sites make the mistake of geocoding addresses each time a page loads, but doing so will result in slower page loads and unnecessary repeat geocodes. It's always better to hardcode the latitude/longitude information when possible.
Source : code.google.com

0 comments:

Post a Comment