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!
Solved! Go to Solution.
On line 70 you have a "." rather than a comma.
On line 70 you have a "." rather than a comma.
Thank you so much! It's working fine now. It's always the stupidest thing isn't it?
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!
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
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.
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.
The works perfectly, thank you so much for your help Tim!
No problem, don't forget to mark the posts as helpful!
Thanks
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