RegisterTomTomMapLayerSource
This method is used to register a single TomTom Online Map 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.MapLayerSourceOptions | 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 Maps documentation.
Name | Default | Required | Type | Description |
---|---|---|---|---|
ApiKey | null | Yes | String | The API Key provided to you when you register with TomTom. |
Layer | LayerEnum.Basic | No | LayerEnum | The layer of the tiles to be rendered. |
Style | StyleEnum.Main | No | StyleEnum | The style of the tiles to be rendered. |
View | ViewEnum.Unified | No | ViewEnum | The Geopolitical view of the tiles. |
Language | "NGT" | No | String | The language to be used in tile labels. |
Example
void Application_Start(object sender, EventArgs e)
{
...
// Set options for the TomTom layer-source
var options = new Platform.TomTom.MapLayerSourceOptions {
ApiKey = "[Your TomTom API Key]",
Layer = Platform.TomTom.MapLayerSourceOptions.LayerEnum.Basic,
Style = Platform.TomTom.MapLayerSourceOptions.StyleEnum.Night,
View = "NGT",
Language = "fr-FR"
}
// Register the TomTom layer-source
Mapzania.Services.RegisterTomTomMapLayerSource("TOMTOM_TILES_NIGHT", options);
// Start Mapzania
Mapzania.Services.Start(this);
AreaRegistration.RegisterAllAreas();
GlobalConfiguration.Configure(WebApiConfig.Register);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
...
}