Select to view content in your preferred language

Using a map server other than ArgGIS

2905
10
01-20-2016 04:16 PM
DaveSouthern
New Contributor II

We have a web application where we use an ArcGIS server up in the cloud somewhere to serve up the background layer for our map (topographical or whatever the user wants.)  This is working fine on our development machines here in the states.  When our app gets deployed, however, it may be in a situation where it is running on a server in a local network at a FOB or some such situation where there is limited or non-existent access to the internet as a whole.  We don't want to use ArcGIS server because, well, quite frankly, the customer doesn't want to pay for it.

I've seen some third party open source GIS servers out there and am wondering if we can use any of these to serve up our background layer while still using the ArcGIS api for javascript to do all other layer creation and feature manipulation.  We've written an extensive amount of client side code using the ArcGIS api, and re-writing all of it is out of the question.

So has anybody out there done anything similar to this?  Is it easy?  hard?  Can it be done at all?  Are there any gotchas?

Any advice would be appreciated.

0 Kudos
10 Replies
ChrisSmith7
Frequent Contributor

One thing to be aware of right off the bat is licensing... The API is "free" under the following scenarios:

  • Development and Evaluations
  • Non-commercial external use
  • Education(teaching purposes only)
  • NGO or not-for-profit business
  • When used in conjunction with ArcGIS for Server license
  • When used in conjunction with ArcGIS Online Task Services totaling $4,000 per year or more

Is the ArcGIS Server JavaScript API free to use? - Geographic Information Systems Stack Exchange

I would definitely chat with your Esri rep to cover your bases - to make sure you qualify to use the API. Additionally, you could run into ASP (Application Server Provider) licensing, depending on how you are packaging your services for the client.

That being said, you can do quite a bit with the API itself, sourcing data from an SQL back-end, a JSON/KML feed, etc. (KML | ArcGIS API for JavaScript, Feature collection | ArcGIS API for JavaScript​) I have several layers that are sourced from non-ArcGIS Server sources, creating JSON from data (lat/longs, for instance) and displaying on the map. There are also several public layers available as REST services you could use - check out Search for a Dataset - Data.gov

There are also robust tools to perform client-side analysis of data, as well, negating the need for ArcGIS Server - esri/geometry/geometryEngine | API Reference | ArcGIS API for JavaScript. It really depends on what you're needing to do with the API.

DaveSouthern
New Contributor II

As far as the licensing goes, that would be my dev lead's responsibility, and I'd be surprised if he hasn't already researched it.  This question I'm asking is probably more in his realm of responsibility - I'm just a junior developer on this project - but he's tasked me with doing the research on this one.

To be honest, I'm a little ignorant as to how things really operate in our system.  I tried to find a place in our code where we are specifying a link to the server that we're using for background imaging, but all I could find were hard coded links in init.js - which has me wondering how we can specify a non-esri source for our background layers.  I'll take a look at those articles you linked to about using other sources.  That whole middle paragraph of yours looks a little greek to me - I'm still learning. 

0 Kudos
thejuskambi
Regular Contributor

If you are not worrying about the licensing part. You can use any Tiled/Cached map service as a basemap.

BasemapLayer | API Reference | ArcGIS API for JavaScript

DaveSouthern
New Contributor II

Any Tiled/Cached map service.  OK, that's a start.  But now how does that look in the code?  All the examples I find online set the basemap in the map constructor by passing in one of the pre-defined esri base map names.  How do you set the basemap without setting it in the constructor?

0 Kudos
ChrisSmith7
Frequent Contributor

Basically, like so:

var baseMapLayer = new esri.layers.ArcGISTiledMapServiceLayer("service URL goes here"); 
map.addLayer(baseMapLayer); 
ChrisSmith7
Frequent Contributor

Here's a JS fiddle sample to help:

Tiled Map Service Example - JSFiddle

UPDATED LINK

DaveSouthern
New Contributor II

Aha - so a base map is just another map layer then - nothing special about it.  Somehow I had it in my head that basemaps were somehow different from other layers.

0 Kudos
thejuskambi
Regular Contributor

You could Either use BaseMapGallery to create your own set of basemaps.

BasemapGallery | API Reference | ArcGIS API for JavaScript

or use esri/basemaps to push custom basemaps to a global collection.

esri/basemaps | API Reference | ArcGIS API for JavaScript

DaveSouthern
New Contributor II

So this relates to my next question:  I've been researching third party map servers - one of which is 'mapserver' - but so far what I've seen is that these are tools to serve up the maps - they don't actually contain the maps themselves - you have to get those from somewhere else.  Can I use the tools you mentioned to generate base maps from esri and then put those into a third party server without getting into a licensing issue?

Pardon me if I'm just not understanding how all this works.

0 Kudos