Articles and Tutorials
SmartFIND Maps API Version 2 Upgrade Guide
If your web application was developed using Version 1 of the SmartFIND Maps API follow the instructions in this document to upgrade to Version 2.Overview
Version 2 of the Maps API is broadly backwards-compatible with the Version 1 release, however in some areas we've chosen to break backwards compatibility to enable us to evolve new functionality and to achieve a higher level of consistency in the API interface.
While we will continue to support Version 1 of the API for an indefinite period we encourage you to upgrade as Version 2 of the API contains a number of significant internal changes and bugfixes.
Incompatibilities Between Version 1 and Version 2
For most code written to use Version 1 of the Maps API all that should be required to upgrade to Version 2 is to change your code that instantiates the GSMap class as the names of the options that can be specified, and the way in which these options are passed to the map's constructor, have changed.- The GMap class is now instantiated with 2 arguments, container which can be either a reference to the DOM element that will contain the map, or the value of the id property of that element; and options an object literal specifying the map options to set. The supported map options may either be specified when the map is instantiated, or dynamically using the GSMap.setMapOptions() method.
- GSMap.setSize() no longer takes a resizeable argument. In V2 configuration of the map's resizing behaviour is done independently using the GSMap.setMapOptions() method.
New Features Introduced in Version 2
The focus of the Maps API Version 2 release has been to provide more flexibility in how the API can be used. Some of the features introduced include:- Custom Map Controls - custom map controls can be created by subclassing the in-built GSControl class. For more information on using custom map controls see Creating Custom Map Controls.
- Map Control Positioning - positioning of both in-built and custom map controls can now be specified when adding controls to the map
- Improved Info Window - the info window is now simpler and more flexible. A reference to the info window can be obtained from its parent map allowing its content to be updated and visibility to be controlled
- Snapback Map Functions and Map Control - using GSMap's snapback functions the map position can be saved and restored at a later point in time. The snapback map control displays a snapback button on the map for activating the snapback function.

