1

Map layers

Тема: Map layers

Hey all

You can add custom map layer to application. We added special resource settings for it.

+ How to add custom map layer

1. First of you have to find map. We'll use Esri.WorldImagery in this sample. We need server URL and layer parameters to continue:

// server URL
https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}

// parameters
{
    "attribution": "Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community"
}
+ открыть спойлер

Map layers

2. Open Maps tab in Hecterra and press "Add" button
3. Fill layer form
   - Title - layer name (will be shown in app)
   - URL - server URL (we get it on previous step)
   - Tile layer / WMS - tile layer type. It depends on server type, if you're not sure - try both
   - Overlay - layer will be shown above other layers (useful for cadastre or traffic layer)
   - Parameters - JSON, Leaflet TileLayer Options. In this sample we use it to set attribution

+ открыть спойлер

Map layers

4. Save setting and lets check. You can select new "Custom layer" on map.

+ открыть спойлер

Map layers

+ Settings import and export

To make configuration more comfortable we added import/export feature. Here's import config of previous example

[
  {
    "title": "Custom layer",
    "url": "[url]https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}[/url]",
    "params": {
      "attribution": "Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community"
    }
  }
]
  • Map layers
  • Map layers
  • Map layers