Select to view content in your preferred language

Public Maps Gallery template version 1.4  --Opening post

33402
175
11-22-2011 02:57 PM
Esriwebmap
Occasional Contributor


Please reply to this opening post to submit questions and comments about the Public Maps Gallery (PMG) template version 1.4.
Tags (2)
0 Kudos
175 Replies
MattDriscoll
Esri Contributor
0 Kudos
ElizabethLahey
Emerging Contributor
I'm having issues with opening some of the maps in our map gallery - I first noticed this happening on 12/24. I updated and resaved the information for some of our ArcGIS Online maps, and this seems to have changed how the URL is opened in our map gallery for those items. I did not make any changes to the code for our gallery and it was previously working fine.

When you click on a map in our gallery, it used to open with the URL formatted like this: http://dnrc.mt.gov/gis/gallery/map.html?webmap=31795d4989dd47f192914d47a57bee18. Items in the gallery that I've recently saved now direct you to a URL that's formatted like this: http://dnrc.mt.gov/gis/gallery/state_of_montana_trust_lands_1326385606393. The second link doesn't exist - any thought on why the gallery might be looking for this URL now?
0 Kudos
MattDriscoll
Esri Contributor
I'm having issues with opening some of the maps in our map gallery - I first noticed this happening on 12/24. I updated and resaved the information for some of our ArcGIS Online maps, and this seems to have changed how the URL is opened in our map gallery for those items. I did not make any changes to the code for our gallery and it was previously working fine.

When you click on a map in our gallery, it used to open with the URL formatted like this: http://dnrc.mt.gov/gis/gallery/map.html?webmap=31795d4989dd47f192914d47a57bee18. Items in the gallery that I've recently saved now direct you to a URL that's formatted like this: http://dnrc.mt.gov/gis/gallery/state_of_montana_trust_lands_1326385606393. The second link doesn't exist - any thought on why the gallery might be looking for this URL now?


The logic that happens is if the item object has a "url" property it uses that otherwise it uses the webmap ID. Does this item have a URL entered in it's object? Any way to remove the URL so it just opens as a webmap?

I'm not sure why it has a URL if it's just a webmap.

Thanks
0 Kudos
ElizabethLahey
Emerging Contributor
The gallery items are all ArcGIS Online web maps from our public ArcGIS Online group (http://www.arcgis.com/home/group.html?owner=MontanaDNRC&title=Montana%20Department%20of%20Natural%20...). I recently edited and saved the High Hazard Dams, State Trust Lands, and Wildfire Protection maps - not the actual map content, I just changed the thumbnail image. After I did that, the gallery started looking for those three maps at the new URLs instead of with the webmap ID. The rest of the web maps in my gallery still go to the address with the webmap ID and work fine.

If it helps to see this in action, our gallery is here: http://dnrc.mt.gov/gis/gallery. I can still get to the maps for those three items by manually entering the address - but for some reason the gallery now thinks those three have a URL and directs our users to that location.
0 Kudos
ElizabethLahey
Emerging Contributor
This morning I created a brand new ArcGIS Online map and shared it with the group used by my gallery. Worked great - showed up in the gallery and the link brought me to the webmap ID address when I clicked on the new gallery item. I then went and edited the information about the map (description, access and use constraints). After I saved that information and tried to view the map in the gallery again, the gallery link sent me to the URL for the map (which doesn't actually exist).

It definitely seems tied to editing the information about the ArcGIS Online map - is there something in this process that assigns the map a URL?
0 Kudos
MattDriscoll
Esri Contributor
This morning I created a brand new ArcGIS Online map and shared it with the group used by my gallery. Worked great - showed up in the gallery and the link brought me to the webmap ID address when I clicked on the new gallery item. I then went and edited the information about the map (description, access and use constraints). After I saved that information and tried to view the map in the gallery again, the gallery link sent me to the URL for the map (which doesn't actually exist).

It definitely seems tied to editing the information about the ArcGIS Online map - is there something in this process that assigns the map a URL?


Hi Elizabeth,

We've found the problem and applied a fix for the next update. Thanks!
0 Kudos
PtomHarner
Deactivated User
I'm experiencing the same problem - when you say 'next update', does that mean something that changes on esri's end or something that we will have to update and change on ours? Also, any timeline for the update?
Thanks
0 Kudos
MattDriscoll
Esri Contributor
I'm experiencing the same problem - when you say 'next update', does that mean something that changes on esri's end or something that we will have to update and change on ours? Also, any timeline for the update?
Thanks


It will occur on Esri's end sometime this week. A code change may be necessary if you're hosting the app yourself otherwise it will automatically be fixed.
0 Kudos
PtomHarner
Deactivated User
Thanks. We are hosting the app ourselves - do you have pointers on what code needs to be changed?
0 Kudos
MattDriscoll
Esri Contributor
Thanks. We are hosting the app ourselves - do you have pointers on what code needs to be changed?


Hi Tom,

Yes, if you're using the latest version of the template you can just replace /javascript/home/layout.js.

If you've modified or are using a previous version, you'll need to change this if statement

if (data.results.url) {
                itemURL = data.results.url;
                externalLink = true;
            }


to this:

if (data.results.url && data.results.type === "Web Mapping Application") {
                itemURL = data.results.url;
                externalLink = true;
            }


And the same thing for the autocomplete.

if (ACObj[locNum].url && ACObj[locNum].type === "Web Mapping Application") {
                mapURL = ACObj[locNum].url;
            }
0 Kudos