Select to view content in your preferred language

error  _layerCurrent is undefined when using shortlist template on local machine

2970
8
01-25-2014 02:56 AM
OliverRau
Deactivated User
Hi together,

first, sorry for my bad english, i'll try my best.
Ich have went through all steps of creating a webmap by using the shortlist template. I am running an apache webserver on my local machine (win 7) and it is working fine. For testing i changed the webmapid in the index file to "bb54c07ecd3d43e8bf5fce2875df30f6".
I am quite sure that everthing is set fine (sharing the ressources, attributes of shapefile...)
When i am trying to start the webmap by localhost in firefox nothing happens and the firebug console is "TypeError: _layerCurrent is undefined http://localhost/ Line 452". I am really desperated to run the map. Who has an idea?
0 Kudos
8 Replies
RupertEssinger
Esri Alum
Your web map: http://www.arcgis.com/home/item.html?id=bb54c07ecd3d43e8bf5fce2875df30f6 won't work in the Shortlist template because it is using a feature service. The Shortlist only supports shapefiles (uploaded into the web map directly as a zip files) or CSV files (uploaded into the web map directly) for the point layers that define the different tabs. So your shortlist will work fine if you, for example, export your ArcMap layer to a shapefile from ArcMap (or maybe you already have the shapefile because you started off with a shapefile).

Tip: To test a shortlist web map easily, put its web map ID into our generic hosted URL:
http://storymaps.esri.com/templates/shortlist/?webmap=8504932f183c4b8699dc6ba28235e398
replacing the web map ID in the URL above with the ID of your web map:
http://storymaps.esri.com/templates/shortlist/?webmap=bb54c07ecd3d43e8bf5fce2875df30f6
0 Kudos
OliverRau
Deactivated User
Thanks Rupert for your answer. Without using the feature services as a source it is now working fine. The problem was that i had uploaded the shapes in advance through the "add contents" interface and the shapefiles were automatically converted into feature services.
But i still have one problem. Is it not possible to use a foreign tile map source as an basemap? Error: base-map could not be loaded
0 Kudos
RupertEssinger
Esri Alum
Hi Oliver

I can reproduce the issue and I'm looking into it.

If I try and launch your web map:
http://www.arcgis.com/home/webmap/viewer.html?webmap=bb54c07ecd3d43e8bf5fce2875df30f6
in the Shortlist template, it doesn't launch:
http://storymaps.esri.com/templates/shortlist/?webmap=bb54c07ecd3d43e8bf5fce2875df30f6

I've made a copy of your web map, and I've changed the basemap to be one of our standard basemaps:
http://www.arcgis.com/home/webmap/viewer.html?webmap=21ccf49a74194757a3fd770531e91608
and this web map does launch successfully in the Shortlist template:
http://storymaps.esri.com/templates/shortlist/?webmap=21ccf49a74194757a3fd770531e91608

Is there an entry in ArcGIS Online for the basemap that you are using in your web map. In other words, what did you add into your web map in order to make that your basemap?
0 Kudos
OliverRau
Deactivated User
Can you post the URL of the web map you are trying to use in your Shortlist app?

here it is: http://bit.ly/1iDBv71
0 Kudos
RupertEssinger
Esri Alum
Thanks Oliver, and thanks for raising this issue here on the forum: It looks like the Shortlist app template code needs updating in order to point at a more recent version of our Javascript API in order to support tiled layer basemaps like the one your map is using. Try making a copy of the folder you've downloaded the Shortlist template into, and in the index.html file in that copy, update the following three lines of code:

Update line 11:
<link rel="stylesheet" type="text/css" href="http://js.arcgis.com/3.8/js/esri/css/esri.css" />

Update line 12:
<link rel="stylesheet" type="text/css" href="http://js.arcgis.com/3.8/js/dojo/dijit/themes/claro/claro.css">

Update line 20:
<script type="text/javascript" src="http://js.arcgis.com/3.8/"></script>

We believe it your Shortlist will work if you make those three changes.

Sorry about the issue.

PS. It may be a bit hard to see the numbered symbols against that basemap you are using because it is quite colorful. One thing you could do is to apply a transparency to that basemap layer in your web map to lighten the basemap a little bit.
0 Kudos
OliverRau
Deactivated User
Thanks Rupert,
the webmap is working fine now. And now after testing the functionallity i am going to make my map much more beautiful. Especially i will try to implemenet some special features. Thank you for your patience.

Oliver
0 Kudos
RupertEssinger
Esri Alum
Hi Oliver.

I am so pleased that is working now, and we'll update our code so that other people using the new tiled layers for their basemaps don't run into the same issue.

We'd like to see your story map when you are finished. Can you add a 'web mapping application' entry into ArcGIS Online to represent your Shortlist story map app, like this one: http://www.arcgis.com/home/item.html?id=6de17002eb9e4ad0bf014575d21e242e . Add 'story map' and 'shortlist' into the Tags to help people find your entry. To add a web mapping application entry, go to My Content and click 'Add Item'. In this way, when you have finished your Shortlist, it will show up in ArcGIS Online if people search for examples of Shortlist apps with a query like this:
http://www.arcgis.com/home/search.html?q=shortlist&t=content&sortField=modified&sortOrder=desc&focus...

Thanks
0 Kudos
RupertEssinger
Esri Alum
And just to let you and other Shortlist users know, today we updated the Shortlist zip file to release an update to the template. You can download the update from the Shortlist section of the new Story Maps website: http://storymaps.arcgis.com/en/app-list/shortlist/

This release includes the fix that we showed you how to do manually above to update the JavaScript API version number that the Shortlist uses. This release includes some additional fixes as follows:

a) fixes the bug where there was a bad screen refresh at the bottom of the screen when you maximized your web browser.

b) fixes the bug where if you opened a Shortlist and immediately pressed the home button, the map extent would shift a little.

c) allows authors for the first time to add supporting point layers in their maps. Previously you could only add line or polygon supporting layers into your map, because all point layers were used to define tabs. There's a new configuration parameter in the Index.html that lets you specify which point layers, if any, you want to be displayed on the map as supporting layers that do not define tabs. For example, you may want to add a point feature onto your Shortlist representing a convention center or a set of points representing transit stations, and allow users to click on these to get more information. So you can now do that. Use any of the CSV files or shapefiles  in the Shortlist /Samples folders as a template for your point layer(s), add the point layer(s) into your web map, and then enter the name of the layer(s) in the new configuration parameter you'll see in the Index.html called: POINT_LAYERS_NOT_TO_BE_SHOWN_AS_TABS. For example, in this Phoenix Shortlist, zoom in on the urban areas
http://storymaps.esri.com/stories/shortlist-phoenix/ and the transit stations appear as supporting point features.

d) if a shortlist only contains one tab, the actual tab control is no longer shown, so the look is much cleaner for one-tab Shortlists:
http://storymaps.esri.com/templates/shortlist/?webmap=10b8cbf55e44423e98806fdc7f05e0a9
0 Kudos