Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Legend items are lost when switching basemap #4016

Closed
jolevesq opened this issue Feb 2, 2022 · 6 comments
Closed

Legend items are lost when switching basemap #4016

jolevesq opened this issue Feb 2, 2022 · 6 comments
Labels
bug-type: regression for: FGP For issues that are in support of the Federal Geospatial Platform problem: bug

Comments

@jolevesq
Copy link
Contributor

jolevesq commented Feb 2, 2022

When we switch from LCC basemap to Web Mercator with the viewer using keys to load the layers, the legend items disappears. Use to works fine in version 3.3.4.

Not working: https://staging.gcgeo.gc.ca/viz/index-en.html?keys=000183ed-8864-42f0-ae43-c4313a860720
Working: https://gcgeo.gc.ca/viz/index-en.html?keys=000183ed-8864-42f0-ae43-c4313a860720

@jolevesq jolevesq added problem: bug bug-type: regression for: FGP For issues that are in support of the Federal Geospatial Platform labels Feb 2, 2022
@james-rae
Copy link
Member

Unfortunately we can't run your staging site. The page is accessible (when on VPN) but all your libraries hosted on viewer-visualiseur-stage.services.geo.ca/apps/RAMP/ give us a 403. Am assuming it's an NrCan only server.

Regardless, the only change in v3.3.5 that would affect this is #4005

My suspicion is something in the projection change (and bookmark encoder/decoder that facilitates the change) is putting a stateOnly: true flag on the child layers that appear from your key'd layer (the layer targets a layer group).

For the dev who digs deeper into this, you can likely hack in a fake RCS response (temporarily) if that makes things easier. The response json in this example is

[
  {
    "layers": [
      {
        "isTimeAware": false,
        "layerType": "esriDynamic",
        "service_url": "https://maps-cartes.services.geo.ca/server_serveur/rest/services/NRCan/900A_and_top_100_en/MapServer",
        "name": "Mineral Areas, Producing Mines, and Oil and Gas Fields (900A)",
        "id": "rcs.000183ed-8864-42f0-ae43-c4313a860720.en",
        "url": "https://maps-cartes.services.geo.ca/server_serveur/rest/services/NRCan/900A_and_top_100_en/MapServer",
        "layerEntries": [
          {
            "index": 1
          }
        ]
      }
    ]
  }
]

@james-rae
Copy link
Member

The guilty party, most likely

@james-rae
Copy link
Member

Johann, if you're feeling brave, you can attempt a fast hack.
Edit rv-main.js in a text editor.

Search for string
a.layerEntries.push({stateOnly:!0,state:c,index:c.index})

Change to
a.layerEntries.push({stateOnly:!1,state:c,index:c.index})

(just flipping true to false, essentially).

I make no promises!!! But could give you an immediate fix instead of waiting for a new release.

@dan-bowerman
Copy link
Member

@jolevesq Please let us know if the potential solution above works for you, and we can ensure this is patched in 3.3.6.

@jolevesq
Copy link
Contributor Author

jolevesq commented Feb 4, 2022

@james-rae @dan-bowerman Thanks for the quick update-fix. I will try and let you know.

@jolevesq
Copy link
Contributor Author

jolevesq commented Feb 4, 2022

@james-rae @dan-bowerman Works perfectly, Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-type: regression for: FGP For issues that are in support of the Federal Geospatial Platform problem: bug
Projects
None yet
Development

No branches or pull requests

3 participants