"Good programmers know what to write. Great ones know what to rewrite (and reuse)" Eric S. Raymond

Display geographic data with PHP and Google Map

Posted: April 11th, 2009 | Author: | Filed under: PHP | Tags: , , , , , | 4 Comments »

Today i created an example in PHP to display data into a Google map. I used my GMaps class (see my previous post) to retrieve geographic information for all the provinces of Italy, as you know i’m italian. I inserted all the data into a table of MySQL with the following fields: id, province, code, area, latitude, and longitude where code is the italian automobile code and area is the name of the region. For instance the province of Pescara has the following record: 69,’Pescara’,'PE’, ‘Abruzzi’, 42.4648, 14.2141.

Provinces of Italy



The example in PHP uses this database to display the geographic data of all the provinces of Italy. You can select the geographic area (region) in a combobox and display the data on a Google Map.

You can download the source code of the example with the database here.

Click here to see the online example.