Exemplo n.º 1
0
 changeBasemap = () => {
   mapActions.changeBasemap(this.props.layerId);
 }
Exemplo n.º 2
0
        } else if (url && url.indexOf(contextual_mapboxid) > -1) {
          wriName = 'wri_contextual';
        }
      });

      //- Basemaps can cause issues with layer ordering and other things,
      //- remove them here and readd them above in updateBasemap
      basemapLayers.forEach(bm => map.removeLayer(bm.layerObject));
    }

    //- Set the default basemap, this will trigger an update from the LayerPanel
    //- It listens for changes to the basemap in the store, and then triggers updateBasemap above
    if (arcgisBasemap) {
      if (this.arcgisBasemaps.indexOf(arcgisBasemap) === -1) {
        this.arcgisBasemaps.push(arcgisBasemap);
      }
      mapActions.changeBasemap(arcgisBasemap);
    } else if (wriName) {
      mapActions.changeBasemap(wriName);
    } else if (map.getBasemap()) {
      mapActions.changeBasemap(map.getBasemap());
    } else {
      //- Use this as a fallback
      mapActions.changeBasemap('wri_mono');
    }

    //- TODO: Add support for a custom basemap
  }

};