RegisterTomTomTrafficFlowLayerSource
This method is used to register a single TomTom Online Traffic traffic-flow layer-source.
To use TomTom layers as background layers-sources, you need to create an account on the TomTom Developer Site.
NOTE: Please note that it is your responsibility to comply with all licensing and legal issues relating to TomTom.
Parameters
Name | Required | Type | Description |
---|---|---|---|
key | Yes | String | This is the layer-source key that will be used to identify the TomTom layer. |
options | Yes | Mapzania.Platform.TomTom.TrafficFlowLayerSourceOptions | Options for registering the layer-source (see below for more details). |
Options
The options in the table below are described in more detail in the TomTom Online Traffic Flow documentation.
Name | Default | Required | Type | Description |
---|---|---|---|---|
ApiKey | null | Yes | String | The API Key provided to you when you register with TomTom. |
Style | StyleEnum.Absolute | No | StyleEnum | The style of the tiles to be rendered. |
Thickness | 10 | No | Integer32 | The thickness of the traffic flows (1-20). |
Example
void Application_Start(object sender, EventArgs e)
{
...
// Set options for the TomTom layer-source
var options = new Platform.TomTom.TrafficFlowLayerSourceOptions {
ApiKey = "[Your TomTom API Key]",
Style = Platform.TomTom.TrafficFlowLayerSourceOptions.StyleEnum.Absolute,
Thickness = 15
}
// Register the TomTom layer-source
Mapzania.Services.RegisterTomTomTrafficFlowLayerSource("TOMTOM_FLOWS", options);
// Start Mapzania
Mapzania.Services.Start(this);
AreaRegistration.RegisterAllAreas();
GlobalConfiguration.Configure(WebApiConfig.Register);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
...
}