Select to view content in your preferred language

Public Maps Gallery template 1.3.1--Opening Post

24653
160
09-28-2011 10:55 AM
Esriwebmap
New Contributor III


Please reply to this opening post to submit questions and comments about the Public Maps Gallery template version 1.3.1.

Note: The comments on the template through Sep 28, 2011 have been copied to this thread so that you can view all the questions and answers in one location.
Tags (2)
0 Kudos
160 Replies
Esriwebmap
New Contributor III
Is there a way to sort the list of maps?
Is there a way to filter the list?

Thanks,
cucinellij


Yes, they can be sorted and filtered. Most of this configuration is at the top of "/scripts/home/local.js" in the two functions queryMaps and queryLayers.

searchType : 'Web Map', 
sortField : 'uploaded', 
sortOrder : 'desc',



sortField: The allowed field names are title, uploaded, type, owner, avgRating, numRatings, numComments and numViews.
sortOrder: Values: asc | desc


The item types are in a PDF as an attachment on this post:
http://forums.arcgis.com/threads/40523-Public-Maps-Gallery-template-1.3.1-Opening-Post?p=147881&view...

Thanks
0 Kudos
xandermavrides
New Contributor III
I think I understand.

If you replace lines 142 and 143 on "/scripts/home/local.js" which has this code

// BUILD LIST ITEM
   html += '<li><a title="' + data.results.snippet + '" href="'+obj.arcgispath+'home/item.html?id=' + data.results.id + '">' + data.results.title + '</span></a></li>';



with this:

if(data.results.url){
    // BUILD LIST ITEM
    html += '<li><a target="_blank" title="' + data.results.snippet + '" href="'+ data.results.url + '">' + data.results.title + '</span></a></li>';
   }
   else{
    // BUILD LIST ITEM
    html += '<li><a target="_blank" title="' + data.results.snippet + '" href="'+obj.arcgispath+'home/item.html?id=' + data.results.id + '">' + data.results.title + '</span></a></li>';
   }


that will open the layers list with the application URL in a new window like you're doing with the featured maps. Some of them are just items and don't have a URL I see so they will just open in ArcGIS.com. You may be able to change that.


Any other thoughts on this?
0 Kudos
Esriwebmap
New Contributor III
Any other thoughts on this?


Hey xander,

What are you trying to do exactly?
0 Kudos
xandermavrides
New Contributor III
Hey xander,

What are you trying to do exactly?


You had it right. I want the featurelayers to open with the application URL and not arcgis. The code provided doesn't seem to fix it. 

If you look and Cleveland Wards as a specific example it's under both fetaurelayers and featuremaps. If opened under featuremaps it opens as http://www.clevelandgis.com/gallery/map.html?webmap=XXXX

If opened under featurelayer it opens as http://www.arcgis.com/home/item.html?id=XXXX

Thanks..
0 Kudos
Esriwebmap
New Contributor III
You had it right. I want the featurelayers to open with the application URL and not arcgis. The code provided doesn't seem to fix it. 

If you look and Cleveland Wards as a specific example it's under both fetaurelayers and featuremaps. If opened under featuremaps it opens as http://www.clevelandgis.com/gallery/map.html?webmap=XXXX

If opened under featurelayer it opens as http://www.arcgis.com/home/item.html?id=XXXX

Thanks..


Oh ok. try replacing this:

if(data.results.url){
    // BUILD LIST ITEM
    html += '<li><a target="_blank" title="' + data.results.snippet + '" href="'+ data.results.url + '">' + data.results.title + '</span></a></li>';
   }
   else{
    // BUILD LIST ITEM
    html += '<li><a target="_blank" title="' + data.results.snippet + '" href="'+obj.arcgispath+'home/item.html?id=' + data.results.id + '">' + data.results.title + '</span></a></li>';
   }
  
  }


with this:

if(data.results.url){
    // BUILD LIST ITEM
    html += '<li><a target="_blank" title="' + data.results.snippet + '" href="'+ data.results.url + '">' + data.results.title + '</span></a></li>';
   }
   else{
    // BUILD LIST ITEM
    html += '<li><a target="_blank" title="' + data.results.snippet + '" href="map.html?webmap=' + data.results.id + '">' + data.results.title + '</span></a></li>';
   }
  
  }


I'm just changing the link to go to "map.html?webmap="
0 Kudos
xandermavrides
New Contributor III
Oh ok. try replacing this:

if(data.results.url){
    // BUILD LIST ITEM
    html += '<li><a target="_blank" title="' + data.results.snippet + '" href="'+ data.results.url + '">' + data.results.title + '</span></a></li>';
   }
   else{
    // BUILD LIST ITEM
    html += '<li><a target="_blank" title="' + data.results.snippet + '" href="'+obj.arcgispath+'home/item.html?id=' + data.results.id + '">' + data.results.title + '</span></a></li>';
   }
  
  }


with this:

if(data.results.url){
    // BUILD LIST ITEM
    html += '<li><a target="_blank" title="' + data.results.snippet + '" href="'+ data.results.url + '">' + data.results.title + '</span></a></li>';
   }
   else{
    // BUILD LIST ITEM
    html += '<li><a target="_blank" title="' + data.results.snippet + '" href="map.html?webmap=' + data.results.id + '">' + data.results.title + '</span></a></li>';
   }
  
  }


I'm just changing the link to go to "map.html?webmap="


PERFECT!!!! Thanks for timely response.
0 Kudos
MicahWilliamson
Occasional Contributor II
If you change line 26 to "perRow : 2," on "/scripts/home/local.js" it should fix that display error.

It's currently added a class "endRow" to every third item which is removing the padding. If you change it to 2, it should only add it to the 2nd item on each column. Or you can remove the endRow class from global.css. That's another option.

Hope that helps.


YES it does, thanks very much. i know this is an 'unsupported' template. but you go to great lengths to help make it work for everyone, thanks for your assistance.
0 Kudos
xandermavrides
New Contributor III
Just when I thought my questions were answered...

For featurelayer:  searchType : 'Web Map'  returns both  Web Map and Web Mapping Applications on the featurelayer list. I can't seem to isolate just the web maps on the feturedlayers list. 

However, if I try searchType : 'Web Mapping Application'  it does isolate my flex apps on both the featuremaps and featurelayer. web map are not shown at all.
0 Kudos
Esriwebmap
New Contributor III
Just when I thought my questions were answered...

For featurelayer:  searchType : 'Web Map'  returns both  Web Map and Web Mapping Applications on the featurelayer list. I can't seem to isolate just the web maps on the feturedlayers list. 

However, if I try searchType : 'Web Mapping Application'  it does isolate my flex apps on both the featuremaps and featurelayer. web map are not shown at all.


Yeah, I think you're right about that. I'll play around with it tomorrow to see if I can isolate just the web maps.

One way to get around it would be to filter out all returned items that have a URL defined. Currently, it creates the list item to open in a new window but if you comment out that line it shouldn't show any Web Applications at all.

if(data.results.url){
    // BUILD LIST ITEM
    // html += '<li><a target="_blank" title="' + data.results.snippet + '" href="'+ data.results.url + '">' + data.results.title + '</span></a></li>';
   }
0 Kudos
Esriwebmap
New Contributor III
YES it does, thanks very much. i know this is an 'unsupported' template. but you go to great lengths to help make it work for everyone, thanks for your assistance.


No problem! glad I can help.
0 Kudos