Web Apps Addresses

From Online Business Wiki

(Redirected from Map)
Jump to: navigation, search

Web Apps include a facility for storing, rendering, and searching address data.

Contents


Preparing Web Apps for Mapping

With the release of our web app mapping modules, you now have the ability to map out the data you and your customers add to your site. To enable this, we have added a new set of fields on the web app items that tracks the address. Before you can use this on your items, you must enable the functionality on the web app configuration page.

image:Enableaddress.png

Once the Address feature is enabled, you will be able to access a new section on each item that lists the addresses (and also have coinciding tags available for your layouts). When entering addresses, it is critical to enter the state field (for countries with states/provinces) with the correct postal service abbreviation - e.g. "CA" not "California", "QC" not Québec, "NSW" not New South Wales. It's also important when importing to import the country code (this is set automatically when saving).

image:AddressEdit.png

In google maps, there is a marker which shows the specific point being plotted and will display some information about the point when clicked on. In our system, the "Web App Title" and "Web App Item Content" are the items that are inserted into the plotted point text. If you currently are using the item content field as a source for textual data in the web app you may need to consider creating a new field in your app and moving that data over into the new multiline text field if you do not want that data to be put on the mapping plot.

image:WebAppMapDescEdit.png

Moving Web App Content in Existing Items

First you will need to create a new multiline field in the webapp.

You then should export your web app items. You will modify them in excel by moving the current Item Content field into this new field.

After this you can import all your web apps again and they will have the information moved, enabling you to use the content space for the info you desire to be placed on the map.

Getting your Google API key

Before you can begin working with Google maps, you need to get your API key from google. Go to google code and follow their instructions on how to signup for the key. Keep in mind that this key should be for your live domain and not the system domain. The Google API key is only good for a specific domain and its associated subdomains. For example, the key for *.worldsecuresystems.com is ABQIAAAAFpzxY6IeWCvvzZBuZgZEFRScORB2vu23Xe0GmXrkmbsnDwR-VhR9W-Y43KrBb8dE8sVMwbyjiM8sMw.

In order to maximize compatability register the domain mysite.com and not www.mysite.com with Google. By applying the key to the domain without any subdomains, you will have the ability to use it for all subdomains on your site. If you specify the subdomain (such as www) upon registering for your key, it will only be good for that specific subdomain.

You should take care to keep this key in a file for future use.

Inserting a Map Module

In our system, we have a module for both search results and also a separate one which is a mapped presentation of a web app item list.

Listing Web App Items on a Map

{module_webappsmap,ID,filter,itemID,googlekey,width,height,resultsperpage}

   * ID - system generated web app id (do not change)
   * filter - filtering criteria for display and can be one of the following:
         o i - individual item
         o a - all items
         o l - latest items
         o r - random item 
   * itemID - system generated individual item id (do not change)
   * googleKey - the Google API key for the domain
   * width - width of the map (default is 400px)
   * height - height of the map (default is 400px)
   * resultsPerPage - total number of items per page before pagination is used

This module can be placed on any page where {module_webapps} is currently used.

Returning a Web App Map from Search

{module_webappsresultsmap,google_key,width,height,resultsPerPage}

   * googleKey - the Google API key for the domain
   * width - width of the map (default is 400px)
   * height - height of the map (default is 400px)
   * resultsPerPage - total number of items per page before pagination is used 

This module can be placed on any page where {module_webappsresults} is currently used.

Distance Search

If you are using the distance search feature in the web app search form, and you provide a distance, the postal code field is also required. You'll need to add a "please select" item to your distance dropdown with a blank value, or use a textbox instead of select for the dropdown.

Using Mapping Functionality with Web App Layouts

Address-related Tags for Web App Layouts

These tags are available in both the list and detail views of Web Apps with the address feature enabled.

  • {tag_address1}
  • {tag_address2}
  • {tag_addresscity}
  • {tag_addressstate}
  • {tag_addresszipcode}
  • {tag_addresscountry}
  • {tag_addresslatitude} - of the ZIP/postal code of the address.
  • {tag_addresslongitude} - of the ZIP/postal code of the address.
  • {tag_addressglatlng} - for convenience. same as "new GLatLng({tag_addresslatitude},{tag_addresslongitude})"

Advanced Topics

You can also render maps using another mapping vendor (e.g. MapPoint or Yahoo!) by using the backup layout combined with {tag_addresslatitude} and {tag_addresslongitude} to create the appropriate JavaScript to populate the map with a second {module_webapps} on the page.

By default, the distance feature of the search is in the units for the country of the default URL of the site (e.g. miles for US, km for Australia). You can override this by adding a hidden field nameded DistanceUnit_webappid with the unit you prefer ("mi" or "km") as the value.

The script generated by {module_webappsmap} and {module_webappsresultsmap} returns a GMap2 object you can use to customize the map. The object is named webapp_map_ID_gmap2 - where ID is replaced with the numeric identifier for this particular Web App.


Supported Countries

This facility is currently available for addresses in Australia, the United States, Canada, and the United Kingdom. If you would like to use this feature for another country, and have access to latitude and longitude data for all the country's postal codes, please contact support and we will work with you to add support for that country.

Personal tools
Support Material