Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Hello everybody
I've tried this code proposed by Derek Swingley in JSFIDDLE:
JSFIDDLE-FeatureLayer from JSON
Everything "seems" to work fine, but not always. If you go down to the closer scale (level 21 I suppose) and click several times on different points of the line, sometimes you get a popup with the text "(1 of 3)" in the black section of the popup and sometimes you get the text "Buck Creek 3". Once you press in the arrow keys of the popup, this title doesn't return, you will always have the "(x of 3)" text and, besides, the order is a bit strange. Pressing the right arrow, it passes from "Buck Creek 3" to "Buck Creek 2" and after that to "Buck Creek 3" again. It's needed to press several times the left arrow to get to "Buck Creek 1".
I have built a similar example, replacing lines with points in the json. In this case, I never get the "(1 of 3)" text when the popup has just opened. Now, similarly, if I press the arrow keys of the popup, I always get the "(x of 3)" text. And with points I have same problem with the order.
I think the problem is related to the matter that the feature layer is coming from a JSON, because if I create it from an ArcGIS Server URL I'm not able to reproduce the problem. But the problem is that I need to take the data from the JSON.
Do you know if it's possible to modify this behavior? I prefer having the "(1 of 3)" text from the very beginning and see the elements in the right order.
Thanks in advance,

share|improve this question
Since you modified the fiddle, your final code would greatly help anyone willing to help you debug it. –  lynxlynxlynx Feb 14 '13 at 10:54
Thank you very much, "lynxlynxlynx", for you interest. I have created my fiddle. To clarify what is happening, I have added an alert. Take a look at the title and position of the popup before and after the alert. The link to the fiddle is: JSFIDDLE –  Santiago Horcajo Feb 15 '13 at 8:06
Is there somebody who can help me? –  Santiago Horcajo Jun 19 '13 at 14:45
Finally I got it working. See this fiddle: JSFIDDLE –  Santiago Horcajo Jun 28 '13 at 10:40
It would be best to post that as an answer and then accepting it (fine by FAQ). Include a short description of how you fixed it, so future visitors can learn from it. –  lynxlynxlynx Jul 3 '13 at 17:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.