User Manual
Concepts
Get Started
- Pre-Requisites
- Install the NuGet Package
- Obtain Leaflet
- Obtain a License
- Initialize Mapzania
- Initialize Endpoints
- Adding a JavaScript Reference
- Add a Map to a Web Page
- Add Data to a Map
- Style a Map
- Further Reading
JavaScript Client
- Introduction
- Creating a Map Object
- Customize the Map Toolbar
- Map Events
- Mouse and Drawing Behaviour
- Map Extents
- Refresh/Reset the Map
- Working with Layers
- Displaying Layers
- Working with Layer Data
- Styling Layers
- Transforming Layers
- Working with Features
- Displaying Features
- Styling Features
- Working with the QueryEngine
DotNet Server
Adding a Mapbox LayerSource
Mapbox provides a number of attractive tile-sets that can be used out-of the box in Mapzania.
To use Mapbox tile-sets as background layers-sources, you need to create an account on the Mapbox website. You will then have access to all the standard Mapbox tile-sets in addition to having the ability to create your own tilesets.
Adding a Mapbox tile-set to use as a background layer-source is easily done using a few lines of code.
This is illustrated in the example below:
Example
void Application_Start(object sender, EventArgs e)
{
...
// Set options for the Mapbox layer-source
var options = new Platform.Mapbox.LayerSourceOptions {
MapId = "mapbox.satellite",
AccessToken = "[Your Mapbox Access Token]"
}
// Register the Mapbox layer-source
Mapzania.Services.RegisterMapboxLayerSource("MAPBOX_SATELLITE", options);
// Start Mapzania
Mapzania.Services.Start(this);
AreaRegistration.RegisterAllAreas();
GlobalConfiguration.Configure(WebApiConfig.Register);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
...
}
NOTE: It is important that the Mapzania.Services.RegisterMapboxLayerSource method be called before the Mapzania.Services.Start method. If this is not done, the layer-source will not be activated.
See Mapzania.Services.RegisterMapboxLayerSource for reference documentation.