Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

wb-google-addresspicker

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wb-google-addresspicker

Angular directive to convert a simple input text into a fully featured google maps address picker

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Angular directive: wb-google-addresspicker

license

NPM


Description

This is a directive for angular (based on jQuery Address Picker project). It will convert a simple input text into a fully featured google maps address picker with typeahead.

Demo


Install with NPM

npm install wb-google-addresspicker --save

Install with Bower

bower install wb-google-addresspicker --save

HOW TO

Dependencies

  1. jQuery

  2. jquery-addresspicker

  3. API_KEY for Google Maps

    http://maps.google.com/maps/api/js?key=<MY_API_KEY>&language=en
    

Options (see jquery-addresspicker)

{
  appendAddressString: "",
  draggableMarker: true,
  regionBias: null,
  bounds: '',
  componentsFilter:'',
  updateCallback: null,
  reverseGeocode: false,
  autocomplete: 'default',
  mapOptions: {
      zoom: 5,
      center: new google.maps.LatLng(46, 2),
      scrollwheel: false,
      mapTypeId: google.maps.MapTypeId.ROADMAP
  },
  elements: {
      map: false,
      lat: false,
      lng: false,
      street_number: false,
      route: false,
      locality: false,
      administrative_area_level_3: false,
      administrative_area_level_2: false,
      administrative_area_level_1: false,
      country: false,
      postal_code: false,
      type: false
  },
  autocomplete: '' // could be autocomplete: "bootstrap" to use bootstrap typeahead autocomplete instead of jQueryUI
}

Demo

<div class="row">
        <div class="col-md-6">
            <p>
                <input class="form-control"
                       type="text"
                       autocomplete="off"
                       data-ng-model="ctrl.address"
                       data-gap-model="ctrl.addressFull"
                       data-gap-options="ctrl.addressPickerOptions"
                       data-wb-google-addresspicker>
            </p>
        </div>
        <div class="col-md-6">
                <pre>Address: {{ctrl.address | json}}</pre>
            <p>
                <pre>AddressFull: {{ctrl.addressFull | json}}</pre>
            </p>
        </div>
    </div>

Add angular module 'WB.GAddressPicker' as dependency in your app

(function() {
    'use strict';

    angular
        .module('demoApp', [
            'WB.GAddressPicker'
        ])
        .controller('demoCtrl', DemoController);

    function DemoController() {
        var ctrl = this;

        ctrl.address = '';
        ctrl.addressFull = null;

        ctrl.addressPickerOptions = {
            distanceWidget: true,
            addressComponents: true,
            elements: {
                map: true,
                lat: true,
                lng: true,
                street_number: true,
                route: true,
                locality: true,
                administrative_area_level_3: true,
                administrative_area_level_2: true,
                administrative_area_level_1: true,
                country: true,
                postal_code: true,
                type: true
            }
        };
    }
})();

Notes

  • This is fork from bygiro/Angular-Address-Picker.

License

MIT

Keywords

FAQs

Package last updated on 18 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc