Skip to main content

Maps and Layouts

Modification of the Leaflet maps used is possible by editing two templates:

  • pireps/map.blade.php - This is the map that is shown
  • widgets/live_map.blade.php - This is the template for the live flights/ACARS map. This uses Rivets.js to do dynamic databinding to update the map

Base Map

Providers

The providers uses the leafet-providers library. You can use this link to see a preview of the available base map providers.

You can modify the base map, like the type of map used, or passing in additional Leaflet options. To change the base map, you can pass in a providers object to the leafletOptions object:

phpvms.map.render_live_map({
// ...
leafletOptions: {
scrollWheelZoom: false,
providers: {
// SET PROVIDERS HERE
}
}
// ...
});

Providers are in this format, where the options are used to populate the options for that provider (API keys, other default options as specified in the leaflet-providers)

providers: {
provider-name: {
// options
}
}

For example, the default is:

leafletOptions.providers = {
'Esri.WorldStreetMap': {},
}