dymaptic / GeoBlazor

Core Components for the Dymaptic GeoBlazor Library
MIT License
109 stars 19 forks source link

Version/3 Basemap Styles #292

Closed TimPurdum closed 10 months ago

TimPurdum commented 10 months ago

ArcGIS has updated how they define basemaps. They have a new basemap rest service https://developers.arcgis.com/rest/basemap-styles/ that defines the "default" basemaps hosted by Esri with the following JS code:

basemap: {
    style: {
        id: "arcgis/topographic"
    }
}

This looks like it will eventually replace being able to set view.map.basemap directly to a string value, and the old strings are marked as legacy here https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap.

To keep up with ArcGIS, and actually make discoverability simpler in GeoBlazor, I'm creating an enum that has the entire list of style ids. I chose to call them Name in GeoBlazor, since that seems to make more sense for a string/enum.

Here is the implementation in GeoBlazor:

<MapView>
    <Map>
        <Basemap>
            <BasemapStyle Name="BasemapStyleName.ArcgisTopographic" />
        </Basemap>
    </Map>
</MapView>

I have also