As part of this order, a script was developed that is based on the Google Maps API to display zip code area boundaries. The Google Maps API, the Google Geolocation API and the Google Fusion Tables API were combined for this purpose. The following data set, which is available in the public domain, was used as the basic data set for the area boundaries Data set used. This still had to be adapted and converted.

Google Geolocation API

Google Maps® Postcode search section
Google Maps® API postal code areas on a Macbook

In addition, all area boundaries are indicated by a marker (the zip code). This marker can also be selected, which opens a popup that can again be equipped with any text. The example image shows that the zip code is displayed, as well as another text with a link, which also contains the zip code so that it can be used for other purposes.

The script reacts to GET parameters in the browser, which determine the color and selection of the postal codes. An example call with only one zip code would look as follows with the default settings: ?script.php?zip=46509&mColor=ff0000. The parameter names can be changed as required.

Since the aim of the project was to be able to mark surrounding zip codes for a main zip code with two different colors, there are additional parameters: script.php?zip=46509&mColor=ff0000&rZip=46459,47665&rColor=0000ff&fZip=46487&fColor=00ff00.

As can be seen in the example, several zip codes can also be entered, in this case separated by commas. The separator can also be changed as required. The script accepts 3 different types of zip codes, each with a color, and displays them in color on a Google Maps map.

The advantage of the implementation is that the script can be integrated into existing websites. Either as a dynamically moving map or as an image section. A possible application scenario could be a store that only delivers various products to certain regions. The script could be integrated into the detailed description of the products and display the regions to which the product can be delivered in two colors, for „immediately available“ or „currently sold out“. The script can also be expanded to include other colors and zip code types, so that a variety of other application scenarios would be possible.