Maps 0.4: parser function changes

This weekend I’ve started working on the last big todo for the 0.4 release of Maps: adding an OSM optimized OpenLayers service. Since this version will see quite some changes for the use of the parser functions, I’m going to elaborate on this.

The main change is that Maps is now able to detect if a given value is a coordinate or not (in which case it’ll be treated like an address). This allowed for letting the display_point function handle both it’s old role, and the one of display_address. Display_point will now auto detect if the default parameter is a coordinate or not, and in case it isn’t, do an attempt to geocode. This behaviour can be ‘overridden’ by using the parameter name coordinate= or address=. The auto detection will also happen when multiple points are passed in display_points, allowing you to pass both addresses and coordinates. The display_address(es) will remain synonymous to display_point(s) for a while, as backward compatibility, but will eventually be removed.

Since this auto detection can also be used for other coordinate/address values, the centre parameter of display_point(s) now also accepts an address instead of only coordinate pairs.

Maps 0.4 will also introduce a new parser function: display_map. This function only accepts one coordinate/address, which will be the map’s centre. Obviously, the same auto detection method is used here.

Leave a Reply

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