Leaflet basemap

Special API samples



This sample demonstrates how to embed a leaflet basemap under the DK.ASPNET map.

Default mode is Zoom. Drag using Shift + left mouse click.

Steps to enable leaflet and configure styling :

  • Page options :
    • In OnGet request set
      ViewData["LeafletCSS"] = "https://unpkg.com/leaflet@1.7.1/dist/leaflet.css";
    • In _Layout.cshtml set
      link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"
  • Viewer web control options :
    • rendering-mode = Leaflet
    • image-format = Png
    • BackColor = Transparent
  • Viewer server side options :
    • RestrictedDrag = false
    • Color = Transparent
    • CS = 3785

Leaflet map control can be retrieved using JavaScript getLeafletMap() function.