Giter Site home page Giter Site logo

pmacmaps / esri-leaflet-geocoder Goto Github PK

View Code? Open in Web Editor NEW

This project forked from esri/esri-leaflet-geocoder

0.0 1.0 0.0 2.57 MB

helpers for using the ArcGIS World Geocoding Service in Leaflet

Home Page: http://esri.github.io/esri-leaflet/examples/geocoding-control.html

License: Apache License 2.0

HTML 2.16% JavaScript 93.22% Shell 0.86% CSS 3.76%

esri-leaflet-geocoder's Introduction

Esri Leaflet Geocoder

The Esri Leaflet Geocoder is a small series of API helpers and UI controls to interact with the ArcGIS Online geocoding services.

npm version build status apache licensed jsDelivr Hits

Example

Take a look at the live demo.

Example Image

<!DOCTYPE html>
<html>
<head>
    <meta charset=utf-8 />
    <title>Esri Leaflet Geocoder</title>
    <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />

    <!-- Load Leaflet from CDN-->
    <link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" />
    <script src="https://unpkg.com/leaflet/dist/leaflet-src.js"></script>

    <!-- Load Esri Leaflet from CDN -->
    <script src="https://unpkg.com/esri-leaflet"></script>

    <!-- Esri Leaflet Geocoder -->
    <link rel="stylesheet" href="https://unpkg.com/esri-leaflet-geocoder/dist/esri-leaflet-geocoder.css">
    <script src="https://unpkg.com/esri-leaflet-geocoder"></script>

    <!-- Make the map fill the entire page -->
    <style>
    #map {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
    }
    </style>
</head>

<body>
    <div id="map"></div>
    <script>
    var map = L.map('map').setView([45.5165, -122.6764], 12);
    var tiles = L.esri.basemapLayer("Streets").addTo(map);

    // create the geocoding control and add it to the map
    var searchControl = L.esri.Geocoding.geosearch().addTo(map);

    // create an empty layer group to store the results and add it to the map
    var results = L.layerGroup().addTo(map);

    // listen for the results event and add every result to the map
    searchControl.on("results", function(data) {
        results.clearLayers();
        for (var i = data.results.length - 1; i >= 0; i--) {
            results.addLayer(L.marker(data.results[i].latlng));
        }
    });
    </script>
</body>
</html>

API Reference

Controls

a control for auto-complete enabled search

Services

A basic wrapper for ArcGIS Online geocoding services. Used internally by L.esri.Geocoding.geosearch.

Tasks

An abstraction for submitting requests to turn addresses into locations.

An abstraction for submitting requests for geocoding suggestions.

An abstraction for submitting requests for address candidates associated with a particular location.

Development Instructions

  1. Fork and clone Esri Leaflet Geocoder
  2. cd into the esri-leaflet-geocoder 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

Resources

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.

Terms and Conditions

In order to make use of the ArcGIS Online World Geocoding Service in your web application:

  1. Please sign up for an ArcGIS for Developers account or purchase an ArcGIS Online Organizational Subscription.
  2. Ensure that Powered byEsri is displayed in the map attribution.

Cost

  1. User search for individual locations within web applications is defined by Esri as Geosearch and it is free. Credits are only consumed when you store results permanently.
  2. To store geocoding results, pass forStorage: true and a valid access token (see #207).
  3. You are not allowed to generate revenue while on a free ArcGIS Developer plan.
  4. If your application generates more than 1 million searches in a month, please contact us.

Licensing

Copyright © 2013-2018 Esri

Licensed 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 file.

esri-leaflet-geocoder's People

Contributors

alaframboise avatar benstoltz avatar bmcbride avatar calvinmetcalf avatar gavinr avatar jgravois avatar jmitz avatar jwasilgeo avatar kneemer avatar lukasdrgon avatar nathanhilbert avatar nickpeihl avatar patrickarlt avatar paulcpederson avatar pmacmaps avatar robertd avatar timwis avatar ungoldman avatar

Watchers

 avatar

esri-leaflet-geocoder's Issues

Locate Mobile Drag Bug

  • figure out at which version issue began (ver 2.2.6 works [6370459])
  • perform git diff 6370459 [bug commit] and identify what code could have introduced bug
  • test code to resolve bug (us gh-pages branch to test your changes to code)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.