The purpose of the GoMap module is to display any map points on the map as distinguished by the specification in the module settings. It includes:
- Description - the text value to place in the marker window when a point is clicked.
- Latitude - a float value of the Latitude of the point.
- Longitude - a float value of the Longitude of the point.
- IconIndex - an integer value cooresponding to the icon index set up in the list of icons in the module settings.
- Timer - an integer value which assists in the animation of the playback feature. In the sample the Timer is calculate as the number of days between the earliest registration record and the record in question. The view is typically ordered by this Timer column. The animation will wait between timer values (0 through the max timer) a pause of 100 milliseconds. Effectively showing a timeline progression in days.
- TimerInfo - the text value to place in the title/alt tag of the start, end and scroller images in the timeline - our sample shows the registration date.
The provided defaults act as both a practical, and highly consumable, example of how to integrate data with the GoMap module. The defaults mimic the popular UsersOnline data, showing the most recent, new today, new yesterday, overall icons but extends the idea by seperating them by country/region.
In order for the default to work in an appropriate fashion two requirements are addressed by the installation -
- Countries and Regions are available to the queries of the Profile information for each user within the DNN installation, but the physical position of those places on the map needed to be defined.
- With a physical definition and mapping of regional information to longitude and latitude, the querying of the data needs to be as optimal as possible. This means that the mapping of the longitude and latitude information cannot rely on the storage mechanics utilized for the DotNetNuke profiles - since it is not highly indexable is not optimal for frequenty queries.
The defaults provided for GoMap address both of these requirements as follows, and define the reasoning behind the "Add Lookup Points" menu item:
- Create a GeoLookup table with appropriate Longitude, Latitude, Country and Region values as well as defining a numeric identity (also called GeoLookup). Add Lookup Points is used to assist the users in training the GeoLookup table. It provides a map which when clicked prompts the user for the Country and Region to be populated in the table at the selected Longitude and Latitude. Instead of adding these points to the table immediatly, we build a script which servers many purposes:
- The user is able review the information before they add it to the site
- Allows the user to copy the script to be executed on multiple installations
- Allows the user to use different GeoLookup tables easily by replacing the name of the default table with one of their choosing.
- A new column as added to the aspnet_profile table titles GeoLookup which identifies the precise GeoLookup identity from the GeoLookup table. This way the binding of the Longitude and Latitude to the profile information for the UsersOnline is immediate, quick and highly optimized.
- A trigger is added to the GeoLookup table which forces an update on the aspnet_profile table GeoLookup column whenever points in the geolookup table are modified, added or removed. This recalculating the correct positioning of the profile information whenever the GeoLookup table is trained via the Add Lookup Points interface.
- A trigger is also added to the aspnet_profile table which forces recalculation of the GeoLookup for the specific profile whenever data within that profile is changed. Therefore recomputing the GeoLookup when Country or Regional information is modified within the profile.
- Finally, the GeoLookup table is automatically populated with 439 distinct points representing all world Countries. States, Provinces and Regional abbreviations for the United States, Canada, India, Germany, France, Australia and the United Kingdom.
The true utilization of the Add Points control is to handle more precise grouping of users. For instance, each of the regions of Australia were added to the GeoLookup table as the full name as it is defined in an Atlas, however, since DNN doesn't provide any governing drop down of the names of these regions, instead providing an open textbox, the system may have many diverse values in the region box. Most australians tend to put an abbreviation in the textbox, so additional points werte added via the Add Lookup Points interface to map to those abbreviations.
When the module is requested, it executes the sample view which we provide, which gathers the tally of users per defined region (where users are registered), and additionally determines the appropriate icon based on the most recent creation date in the profile table for users within that region. In turn, this works like a charm - because the join is occuring on the ID that was precalculated - returning instantly with the most up to date information.