7

Esri provide a lot of excellent template applications for us in conjunction with web maps.

These templates are specifically designed for using with your resources on ArcGIS Online as opposed to ArcGIS Server. (i.e. you supply a web map ID, as opposed to URLs to your GIS Services Directory).

In particular I found this awesome template, that ticks all the boxes for me:

  • Mobile support (e.g media queries, responsive design)
  • Share to social media
  • Nice looking layout
  • Built in Geocoder
    etc. etc.

I have been looking at the code behind it, and was hoping I could reverse engineer it to work with my ArcGIS Server REST endpoints instead. However, does not look like an easy task (im new to Javascript) and believe I would spend more time trying to do this Vs building something from scratch.

Can anyone recommend some template applications to use as a starting point for developing an ArcGIS Javascript API app to use against ArcGIS for Server?

I have already put together the bones of my application in a basic dojo template, but its the stuff mentioned above that I need to also include in my web application.

This will then allow me to focus my development efforts on the actual Esri Javascript API logic, without needing to spend a lot of time having to do a 101 on other aspects of web development.

I understand there are a number of web frameworks out there (e.g Bootstrap) that might assist in some of this, but I was kind of hoping for something a bit more established and aimed at Esri Javascript API. However, would still be interested in answers that do leverage other web framework templates as a starting point.

1
  • 1
    I'm not sure I totally understand the question. The app templates on git mentioned in your question use REST endpoints, for example see the config.js for the land use notification app.
    – geojeff
    Commented Dec 12, 2012 at 23:48

3 Answers 3

4

I completely agree that the ESRI samples are now both out of date and misleading. I notice a few samples are updated to AMD but not many. The samples embedding of JavaScript in the HTML is bad practice that most new comers seem to follow. They are just samples to get across ideas, but many don't seem to realise this.

The Basic Map Viewer provided some very useful features for working with ArcGIS online and making a configurable viewer which fits in with ESRI's AGO framework. This is probably quite similar to the app you were looking at though. Also it's also not structured very well in terms of AMD.

For structuring your code in AMD take a look at odoe's AGSModular demo. It also demonstrates how to build Esri JS code in to a single js using r.js (I never got the hang of Dojo build). It's probably going to be quite a steep learning curve if you are new to JS.

I use the HTML5 boiler plate which helps with a number of cross browser issues. It also includes modernizer for feature detection.

For responsive design I haven't found anything out of the box for web maps that is useful.

4

I always reference the 'samples' section from the ESRI JavaScript API site. I wouldn't call them templates, but the samples all contain the full code to show you how to achieve different tasks and should be especially friendly to new JavaScript developers.

ESRI JavaScript API Site

2
  • I agree they are a good starting place for beginners. But they showcase functionality, and not so much on how to structure an actual web application. gis.stackexchange.com/a/18762/325
    – jakc
    Commented Dec 14, 2012 at 22:53
  • samples on ESRI site shows good how the API works. but the code structure is very messy and it is not good for more complex application. Try to learn OO JavaScript and then mix it with above tutorials. that how I did and it works great for me!
    – Krystian
    Commented Jan 28, 2013 at 22:30
1

I'm in the same boat-- searching for a non-ArcGIS Online responsive template to use with the ArcGIS JS API. This yeoman generator seems to be the best thing at present: https://github.com/knu2xs/generator-esri-bootstrap-map

And if one wanted to hack an ArcGIS JS API map into an existing mapping viewer, this one (with Leaflet) could work: http://bmcbride.github.io/bootleaf/

Or this one (although the tiles appear to be broken): http://wcfcourier.com/app/special/tabletop_to_leaflet/index_cluster.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.