Innovate-Inc / EnviroAtlas

A Repository for the EnviroAtlas application
3 stars 1 forks source link

Allow a single entry in the Layer List widget to represent 2 services #55

Closed torrin47 closed 8 years ago

torrin47 commented 8 years ago

The goal is to be able to split a service by scales, so small scales can be cached and large scales dynamic, but to the user it all appears as a single entry in the table of contents.

Travis Bock has implemented this in another interface (non-WAB) and might have some insight.

torrin47 commented 8 years ago

Test services live and documented in #64

torrin47 commented 8 years ago

Here are the services for proof of concept testing: Dynamic: http://leb.epa.gov/arcgis/rest/services/Other/national_master/MapServer/1 Cached service http://leb.epa.gov/arcgis/rest/services/test_services/Agriculturalwateruse/MapServer Tile cache detached from service http://leb.epa.gov/arcgiscache_exp/AWD_mgal/National%20Data%20-%20EnviroAtlas/

torrin47 commented 8 years ago

tbock@innovateteam.com

torrin47 commented 8 years ago

So in version 4.0 of the JavaScript API, Esri is introducing a new GroupLayer class that essentially accomplishes this functionality.
https://developers.arcgis.com/javascript/beta/api-reference/esri-layers-GroupLayer.html We need to discuss whether to postpone development on this task until we have access to a version of WAB built on version 4.0, or whether to proceed with custom code in the current version. Let's discuss next week.

torrin47 commented 8 years ago

Torrin Hultgren i thought that his "Group Layer" suggestion was a nice one, it might make our lives easier, but it doesn't seem to be available in the 3.x JS API. if we were to use the group layer, it would mean less custom code for ourselves - everything we'd be doing would fit in an esri box. Baohong Ji So we want to wait until WAB upgrade to JS API 4.0? What is your idea? Torrin Hultgren hrm. it's always a little dangerous to count on esri delivering promised functionality on -time and without bugs. the switch to 4.0 seems like a pretty major one, and I am guessing that it may take some time before Esri releases a version of WAB that is built on 4.0. so I seem to be leaning toward continuing to develop our custom code, and if and when 4.0 is available, we could potentially switch if we're not content with the solution we've developed. but honestly, i could easily be convinced otherwise - maybe we need to discuss this as a team next week - focus our development energies on other tasks for now, and make a decision about this task later? that's probably the right choice.
Baohong Ji So I should hold on that and wait for our next week discussion, right? Torrin Hultgren yes please, I think that's what I've talked myself into, with your assistance. I just added that decision into the issue as a comment.

torrin47 commented 8 years ago

Consensus: move forward with 3.x and custom code.

Baohong commented 8 years ago

I have tried the code of TiledMapServiceLayer in our WAB EnviroAtlas project but failed to display the image. There is a simpler class "WebTiledLayer" which is derived from TiledMapServiceLayer and is fully supported in js.arcgis.com/3.15. A sample code of WebTiledLayer is given as below:

<!DOCTYPE html>

``` ```
```
```
brosenbaum commented 8 years ago

as a reminder....

64

For “Agricultural water use (million gallons/day)”

Dynamic is: http://leb.epa.gov/arcgis/rest/services/Other/national_master/MapServer/1

Tiled service is: http://leb.epa.gov/arcgis/rest/services/test_services/Agriculturalwateruse/MapServer

And the one we want to use for mapping – the cached map tiles without service associated – are here: http://leb.epa.gov/arcgiscache_exp/AWD_mgal/National%20Data%20-%20EnviroAtlas/_alllayers

For “Acres of crops that have no nearby pollinator habitat”

Dynamic service is: http://leb.epa.gov/arcgis/rest/services/Other/national_master/MapServer/2

Tiled service is: http://leb.epa.gov/arcgis/rest/services/test_services/Acresofcropsthathavenonearbypollinatorhabitat/MapServer

And the one we want to use for mapping – the cached map tiles without service associated – are here: http://leb.epa.gov/arcgiscache_exp/Acres_Unpo/National%20Data%20-%20EnviroAtlas/_alllayers/

_(the cached map tiles without services can be renamed to match the layer name if needed. Such that in the last example, "Acres_Unpo" could be renamed to "Acresofcropsthathavenonearbypollinatorhabitat" instead of using the variable name AcresUnpo.)

Baohong commented 8 years ago

Barb has generated two set of cache files using "Data Management Tools -> Tile Cache". But still the path for those cached image are in hexadecimal format, like https://leb.epa.gov/arcgiscache_exp/Acresofcropsthathavenonearbypollinatorhabitat/_alllayers/L01/R00000000/C00000000.png

In order to work for WebTiledLayer class, we need those path to be in decimal format. So my suggestion is either stick to the TiledMapServiceLayer class which already works in our code, or write a script to convert those hexadecimal path to decimal format path on server 49.16. I would appreciate it any better solution for WebTiledLayer.

torrin47 commented 8 years ago

And, yes, I take it all back. It seems that while you can vary some aspects of the tile generating schema, such as tile size and scale levels, no matter what, Esri uses the same hex addressing schema Argh. It looks like there's at least one add-in that's a few years old that might be leveraged to generate open tiles: http://www.arcgis.com/home/item.html?id=f7bc5db184034f5f9938112dcaa88e69 but I'm ready to pull the exploration plug and stick with the code Baohong got to work.

On Tue, Feb 23, 2016 at 1:01 PM, Baohong notifications@github.com wrote:

Barb has generated two set of cache files using "Data Management Tools -> Tile Cache". But still the path for those cached image are in hexadecimal format, like https://leb.epa.gov/arcgiscache_exp/Acresofcropsthathavenonearbypollinatorhabitat/_alllayers/L01/R00000000/C00000000.png

In order to work for WebTiledLayer class, we need those path to be in decimal format. So my suggestion is either stick to the TiledMapServiceLayer class which already works in our code, or write a script to convert those hexadecimal path to decimal format path on server 49.16. I would appreciate it any better solution for WebTiledLayer.

— Reply to this email directly or view it on GitHub https://github.com/Innovate-Inc/EnviroAtlas/issues/55#issuecomment-187903240 .

Torrin Hultgren Senior Manager, Geospatial Solutions Innovate!, Inc. O: (703) 922-9090 x737

http://www.innovateteam.com

Innovate!, Inc. is a Virginia-based 8(a), Hispanic- and woman-owned business delivering Geospatial, Information Technology, Security, Business Consulting, Project Management and Executive Coaching solutions to our government and private sector clients. Check us out at www.innovateteam.com.