Giter VIP home page Giter VIP logo

mdimapgeocoder's Introduction

MDiMapGeocoder

A library to use Maryland's cascading geocoder in Node.js and the browser

NPM

##Installation

###Node.js

  • Run npm install mdimapgeocoder
var MDiMapGeocoder = require('mdimapgeocoder')

###Browser

  • Download build/MDiMapGeocoder.min.js
<script src="MDiMapGeocoder.min.js"></script>

##Usage

MDiMapGeocoder.search(address, options?, callback)
  • address - string containing full address or object containing Street, City, State, ZIP
  • options - optional object containing search options (see below)
  • callback - function(error, response) {}

Example

//Single Line
MDiMapGeocoder.search('1101 Camden Ave, Salisbury MD 21801', function(err, res){
  // example response
  res.candidates[0] = 
    {
      "address" : "1101 CAMDEN AVE, SALISBURY, MD, 21801",
      "location" : {
        "x" : -75.609389996999937,
        "y" : 38.342533962000061
      },
      "score" : 100,
      "attributes" : {}
    }
})

//Address Fields
MDiMapGeocoder.search({
  Street: '1101 Camden Ave',
  City: 'Salisbury',
  State: 'MD',
  ZIP: '21801'
}, function(err, res){
  
})

Options

  • wkid (integer) - Specify WKID to return. Default 4326
var address = '1101 Camden Ave, Salisbury MD 21801'
var options = {wkid: 26985} // MD State Plane
MDiMapGeocoder.search(address, options, function(err, response) {
  // response.location = {"x":521564.8398928333,"y":75950.13939312194}
})
  • outFields (array) - The list of fields to be included in the returned results. You may specify any candidate field from the service resource.
var address = '1101 Camden Ave, Salisbury MD 21801'
var options = {outFields: ['ZIP', 'City']}
MDiMapGeocoder.search(address, options, function(err, response) {
  // response.attributes = { ZIP: '21801', City: 'SALISBURY' } }
})

mdimapgeocoder's People

Contributors

frankrowe avatar tahoang avatar

Watchers

James Cloos avatar Phil Reese avatar

Forkers

tahoang

mdimapgeocoder's Issues

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.