Help altering a public Javascript

1511
17
Jump to solution
07-17-2014 01:55 PM
RyanLaird
New Contributor III

Hello everyone,

I'm currently having issues getting my script to work with data hosted on my companies server. The code is copy/pasted from the following link, and the goal is to perform the exact same function but with our data. So far I keep getting an "unexpected token" error for one of the colons on line 71.

Below is my script, it's completely unmodified other than the names of the data, but I could have mistyped anywhere, if you catch something, please let me know. I've attached an HTML file of the script I've adapted.

Thanks!

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
AlexanderNohe1
Occasional Contributor III

On line 70 you have a "." rather than a comma.

View solution in original post

17 Replies
AlexanderNohe1
Occasional Contributor III

On line 70 you have a "." rather than a comma.

RyanLaird
New Contributor III

Thank you so much! It's working fine now. It's always the stupidest thing isn't it?

RyanLaird
New Contributor III

I'm actually still having problems with this script, after the period was fixed the map displayed by my data still won't appear. I know it's there as it can be highlighted, and the pop-up works, but the data won't display until it is selected. I'm pretty sure I can find the problem but we're trying to get this finished ASAP.

Any help would be greatly appreciated!

0 Kudos
TimWitt2
MVP Alum

Ryan,

you have your layer set to only show up if it is being selected:

mode: FeatureLayer.MODE_SELECTION

once you remove that, your layer will show.

Tim

RyanLaird
New Contributor III

Great! That's working like a charm! Thank you very much.

I hate to be a leech, but I have one more thing I would like to get done, but isn't 100% nessesary. My map doesn't zoom to the extent of my data like the other one, is there somewhere in the code I have to just punch in the extent? Sorry about this, I'm still quite new to Javascript.

0 Kudos
TimWitt2
MVP Alum
    map = new Map("map", {
      infoWindow: popup,
      center:[-80.719892, 28.303518],
      zoom:13,
      slider: false
    });

Just replace the center with your coordinates and adjust zoom.

RyanLaird
New Contributor III

The works perfectly, thank you so much for your help Tim!

0 Kudos
TimWitt2
MVP Alum

No problem, don't forget to mark the posts as helpful!

Thanks

0 Kudos
StevenGraf1
Occasional Contributor III

Just thought I would throw this out there.  Here is a training video that may help with some debugging of your application.  I didn't know much about developer tools until I saw this.  It helped me a lot. Esri Training | Time-Saving Tips for JavaScript Developers