wmbeers / cmv-app

CMV - The Configurable Map Viewer - A community supported open source mapping framework built with the Esri JavaScript API and the Dojo Toolkit
https://demo.cmv.io/
MIT License
1 stars 2 forks source link

Thematic Maps #55

Open wmbeers opened 4 years ago

wmbeers commented 4 years ago

Description:

Users need the ability to load a set of map services/layers pulled from various EST (and possibly external) sources. We can't necessarily get there by creating new map services, as that might get hard to maintain. Building off saved maps seems like the logical starting point.

Server-side code changes in https://repo.fla-etat.org/bugzilla/show_bug.cgi?id=6223

wmbeers commented 4 years ago

Feedback from 10/21/2020 meeting:

wmbeers commented 3 years ago

Lex reports map viewer ignores SORT_ORDER of T_SAVED_MAP_LAYER. I've confirmed the DWR request to get the layers is returning them in the right order, but then at some point along the line that ordering gets lost. I strongly suspect it's just the nature of async calls I and CMV are making before the last bit where the layer is actually in the map.

Worst case just re-order when all load promises are complete?

wmbeers commented 3 years ago

at some point along the line that ordering gets lost. I strongly suspect it's just the nature of async calls...

Yes, we get as far as _loadSavedMapLayers and we still have the sort order. It calls addLayer, which is an async call, through _onLayerLoad (callback from "load" event handler on the layer). That alone is enough to scramble the order, because a slow one early in the list could take longer to load, pushing to later in the list. To make it worse, we have to then make a call to the server via esriRequest. I think re-sorting at the end is the only viable option, as everything else would be a nightmare of chained calls.

wmbeers commented 3 years ago

I think re-sorting at the end is the only viable option, as everything else would be a nightmare of chained calls.

It's not so easy to re-sort. See _moveUp to see what's involved in just moving one layer one spot.

Test with switching from map.addLayer to map.addLayers.

wmbeers commented 2 years ago

Demonstrated UI improvement to dev team. Feedback: good for WATERSS, but we're going to set up others based on HCMs (I'll work with Eric on this) and will need a hierarchical structure.