Semantic Maps – Geocoding

I just finished integrating the Google Geocoder function into Semantic Maps. It still needs some tweaking here and there, but the basics are done. All parser functions from Google Geocoder are working, and so is display_address. The main file for this functionality is SM_Geocoder.php, which is located in the root of the extension, and contains static functions to format the coordinates, and a function that, depending on the chosen geocoding service, calls another function in the geocoder’s class, which does the actual geocoding. The goecoder classes are located in the directory Geocoders. At the moment, only a SMGoogleGeocode, that uses the Google Geocoder service, is available yet, but to add a new service, you only need to create a new class for it, and add a reference to it to the switch block in the function determining the class that should be used.

Semantic Maps showing a geocoded address on a Google Map

The wiki-code responsible for this map: {{#display_address:googlemaps|Moscow, Russia|7|normal|550|350}}

My next step will be to get the Yahoo! Maps working to the same point as Google Maps, which will uncover any possible errors in the modularity of the current code.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.