CapeSoft.Com
Clarion Accessories
NetTalk
Doc Index
Maps
CapeSoft Logo

CapeSoft NetTalk
Web Reports

Download Latest Version
Installed Version Latest Version

NetTalk WebServer - Using Maps in a Webserver Application

Introduction

NetTalk introduces the MAP form field type. This means that a map can be included onto a Form.

The map has some basic functionality (starting position and so on). You can also add data to the map from your tables.

This data can be displayed as Markers on the map. Markers can be moved by dragging them (and the underlying record will be updated). If you click on a marker then the form for that marker appears.

Leaflet.js

Leaflet is a light-weight mapping library for JavaScript written by Vladimir Agafonkin. It is distributed with NetTalk as allowed for by the  2-clause BSD License. The NetTalk mapping control is built on top of this library.

Providers

Providers provide the Tile and/or Satellite images which underpin your map. Through the magic of Leaflet you are able to easily change the provider while maintaining the map functionality.

Please note that different providers have different licensing terms of their own. It is critical that you ensure that your application conforms to the terms of the Provider that you choose.

NetTalk contains support for several providers "built-in" - however other providers supported by Leaflet can still be used. If you would like support for a specific provider to be added to NetTalk please contact us.

The pricing and terms mentioned below are a guide and may be inaccurate. Please check the provider's current terms carefully before selecting a provider. It is likely that the data below will become inaccurate over time as the providers change their terms.

The following providers are already supported;

OpenStreetMap

OpenStreetMap is, as the name suggests, an Open-Source style collection of map data. It is created and maintained by the community, and is of a very high standard.

Using the OpenStreetMap data directly from their servers is discouraged (as per their Tile Usage Policy.) They are however the data underpinning some of the providers below.

MapQuest

As of July 2016 MapQuest requires a Developer ID to get started. You can register for an ID at https://developer.mapquest.com/plan_purchase/steps/business_edition/business_edition_free/register
The Free level allows for a number of free transactions per month, after which some paid plans come into effect.

MapQuest provides both Free and Licensed access to their services. You can learn about the differences on their Licensed Data page. Usage of the free (Community Edition) MUST comply with their Terms and Conditions.

If you want to make use of the MapQuest data then you will need an Application Key.

Users are able to switch between Map mode and Satellite mode at runtime.

CloudMade

CloudMade requires you to register on their web site. They will issue you with a developer ID. You can enter this ID on the Maps tab of the WebServer extension.

CloudMade allows you to create new Map Styles (via their developer portal) which let you customize how the maps will look. A large number of styles already exist, and you can choose one of them if you like.

The first 500 000 tiles are free each month, thereafter tiles costs $25 per million tiles ($30 per million if on SSL). Discover more at http://cloudmade.com/products/map-tiles.

Mapbox

Mapbox requires you to sign up to get a free developer key. You can enter this ID on the Maps tab of the WebServer extension.
It has limits on free support, but paid support starts at $5 per month, and includes satellite pictures. Their pricing, and feature set for each level can be found at https://www.mapbox.com/plans/.

Using Mapbox you can create multiple "projects" - each project has it's own ID code. Different projects can have different styles and so on. You will need to create at least one project to use it in your NetTalk app. Terrain style looks good.

Mapbox allows you to create your own custom maps, which can be useful if you are mapping things other than the earth. For example you may need a detailed map of a specific building, or campus, and this may make this a good choice for that sort of use.

Nokia

Nokia requires you to sign up to get a free developer key. You can enter this ID on the Maps tab of the WebServer extension.

While there is a free tier, the  Terms and Conditions on the usage of this tier are laid out very explicitly. It is a good provider choice if your application conforms to these terms and conditions.

Includes Maps and Satellite images as well as a Hybrid mode which combines the two.

Stamen

Maps rendered differently. Can create a unique look for your app.

Esri

Esri is free for development and testing, but requires you to use an account when deploying in production. Their pricing plans can be found at https://developers.arcgis.com/en/plans Plans start from $20 per month.

Google Maps

WebServer Settings

In order to use Maps in your application, you need to set the following in the WebServer procedure;
  1. Go to the NetTalk Extension, Settings Tab, Scripts tab and tick on the option Include Maps Script.
  2. Go to the NetTalk Extension, Defaults Tab, Maps Tab, and select a Provider. If you're not sure which Provider will be best for your application, then use MapQuest - however you will need to select an appropriate provider at some point.

Form Field

You can add a map to your application by adding it as a Form-Field on a form. If this is a Memory form, with no Save button then it in turn can be included on other forms, or as the child of a browse.

The field to be added is of type MAP and does not require a FIELD to be set. It does however require a USE EQUATE. When a field is set to be a Map then the following tabs are visible with additional information about the field; The settings for the map are documented in the WebServer Template Refererence.

Dictionary Layout

Map data is stored as a pair of REAL values, containing the Latitude and Longitude of the data point. The unit of measure is DEGREES, and both the Latitude and Longitude usually contain fractional values.

Latitude is measures in degrees North or South of the equator. Negative values entered here are treated as South, positive values are treated as North.

Longitude is measures in degrees East or West of the Greenwich Meridian (which goes through London, England). Negative values entered here are treated as West, positive values are treated as East.

In addition you may want to store the Zoom Value as a LONG. This can range from 1 ("seen from space") to 16, which is "very close to the ground". Depending on the nature of the data, you may want the user to set (and hence store) the Zoom level which best suits the map.

Displaying Data on the Map

The basic map consists of a Tile Layer (the actual map drawing or satellite picture) and data from the database.
A single map can contain multiple sources of data.

Data on the map is usually represented by a Marker. Data can be edited directly from the map, simply by clicking on the marker.
Markers can also be moved by dragging them around on the map. As the map zooms out, Markers that are close together will be aggregated into a cluster.

A collection of Markers can form the boundary of an Area.

Inserting records by clicking on the Map

On the OnClick tab, for a map field, you can set an Insert Form that will be called when the user clicks on the map.

The form that is called can prime a number of fields, based on the current viewable map, and based on the location which was clicked. This priming is done in the Insert Form, on the Priming tab, on the From Maps tab.
[End of this document]
Return to NetTalk Documentation Index