Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jgravois/esri-leaflet-gp
Plugin for Esri Leaflet to talk to Geoprocessing Services
https://github.com/jgravois/esri-leaflet-gp
Last synced: about 12 hours ago
JSON representation
Plugin for Esri Leaflet to talk to Geoprocessing Services
- Host: GitHub
- URL: https://github.com/jgravois/esri-leaflet-gp
- Owner: jgravois
- License: apache-2.0
- Created: 2014-10-01T05:55:59.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2021-11-16T17:33:18.000Z (almost 3 years ago)
- Last Synced: 2024-10-29T00:30:52.211Z (17 days ago)
- Language: JavaScript
- Homepage:
- Size: 453 KB
- Stars: 20
- Watchers: 5
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: license.txt
Awesome Lists containing this project
README
# Esri Leaflet GP
> an Esri Leaflet plugin for interacting with geoprocessing services published with ArcGIS Server and the analysis services hosted in ArcGIS Online.
Esri Leaflet GP relies on the minimal [Esri Leaflet](https://github.com/Esri/esri-leaflet) Core which handles abstraction for requests and authentication when necessary.
## Demos
Note that the latest version of this plugin requires a minimum of esri-leaflet [2.0.0](https://github.com/Esri/esri-leaflet/releases/tag/v2.0.0).The demos below show the plugin in action
* [calculate a drivetime polygon](http://esri.github.io/esri-leaflet/examples/gp-plugin.html)
* [generate an elevation profile](https://jgravois.github.io/esri-leaflet-gp/elevation.html)
* [route to the closest facility](https://jgravois.github.io/esri-leaflet-gp/closest-facility.html)
* [solve a vehicle routing problem](https://jgravois.github.io/esri-leaflet-gp/demos/vrp.html)## Example
```html
gp drivetime
body {
margin:0;
padding:0;
}#map {
position: absolute;
top:0;
bottom:0;
right:0;left:0;
}#info-pane {
position: absolute;
top: 10px;
right: 10px;
z-index: 10;
padding: 1em;
background: white;
}
document.getElementById('info-pane').innerHTML = 'click on the map to calculate 5 and 10 minute drivetimes';
var map = L.map('map').setView([40, -74.2], 12);
L.esri.basemapLayer('NationalGeographic').addTo(map);
var gpService = L.esri.GP.service({
url: "https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Network/ESRI_DriveTime_US/GPServer/CreateDriveTimePolygons",
useCors:false
});
var gpTask = gpService.createTask();gpTask.setParam("Drive_Times", "1 2");
var driveTimes = L.featureGroup();
map.addLayer(driveTimes);map.on('click', function(evt){
driveTimes.clearLayers();
gpTask.setParam("Input_Location", evt.latlng)
gpTask.run(driveTimeCallback);
});function driveTimeCallback(error, response, raw){
driveTimes.addLayer(L.geoJson(response.Output_Drive_Time_Polygons));
}```
## API Reference### [`L.esri.GP.Service`](http://esri.github.io/esri-leaflet/api-reference/services/gp-service.html)
### [`L.esri.GP.Task`](http://esri.github.io/esri-leaflet/api-reference/tasks/gp-task.html)## Development Instructions
1. [Fork and clone Esri Leaflet GP](https://help.github.com/articles/fork-a-repo)
2. `cd` into the `esri-leaflet-gp` folder and install the dependencies with `npm install`
3. Run `npm start` from the command line. This will compile minified source in a brand new `dist` directory, launch a tiny webserver and begin watching the raw source for changes.
4. The example at `debug/sample.html` *should* 'just work'
5. Make your changes and create a [pull request](https://help.github.com/articles/creating-a-pull-request)## Dependencies
Esri Leaflet GP relies on the minimal Esri Leaflet Core which handles abstraction for requests and authentication when necessary. You can find out more about Esri Leaflet from the [Esri Leaflet Quickstart](http://esri.github.io/esri-leaflet/examples/).
## Resources
* [Geoprocessing Services Documentation](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/GP_Service/02r3000000rq000000/)
* [ArcGIS for Developers](http://developers.arcgis.com)
* [ArcGIS REST Services](http://resources.arcgis.com/en/help/arcgis-rest-api/)
* [twitter@esri](http://twitter.com/esri)## Issues
Find a bug or want to request a new feature? Please let us know by submitting an issue.
## Contributing
Esri welcomes contributions from anyone and everyone. Please see our [guidelines for contributing](https://github.com/Esri/esri-leaflet/blob/master/CONTRIBUTING.md).
## Terms and Conditions
Signup for an [ArcGIS for Developers account](https://developers.arcgis.com/en/plans) or purchase an [ArcGIS Online Organizational Subscription](http://www.arcgis.com/features/plans/pricing.html).
1. Once you have an account you are good to go. Thats it!
2. If you use this library in a revenue generating application or for government use you must upgrade to a paid account. You are not allowed to generate revenue while on a free plan.This information is from the [ArcGIS for Developers Terms of Use FAQ](https://developers.arcgis.com/en/terms/faq/)
## Licensing
Copyright 2017 EsriLicensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at> http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.A copy of the license is available in the repository's [license.txt]( https://raw.github.com/Esri/esri-leaflet-geocoder/master/license.txt) file.