GithubHelp home page GithubHelp logo

rickieanand / js-googlemapsloader Goto Github PK

View Code? Open in Web Editor NEW

This project forked from davidkudera/google-maps-loader

0.0 2.0 0.0 71 KB

Wrapper for asynchronously used Google Maps API in browser.

License: MIT License

JavaScript 92.28% HTML 7.72%

js-googlemapsloader's Introduction

NPM version Dependency Status Build Status

Donate

Google Maps

Wrapper for asynchronously used Google Maps API in browser.

This module does not change original google maps api in any way. It just provide easy way to load and use this API asynchronously.

Installation

Environment with common js:

$ npm install google-maps

Download and import one of these files into your .html file:

Usage

var GoogleMapsLoader = require('google-maps'); // only for common js environments

GoogleMapsLoader.load(function(google) {
	new google.maps.Map(el, options);
});

If you are not using environment with common js support, you can use GoogleMapsLoader variable directly. It is already in window object.

Options

Own API key

GoogleMapsLoader.KEY = 'qwertyuiopasdfghjklzxcvbnm';

Business API client

GoogleMapsLoader.CLIENT = 'yourclientkey';
GoogleMapsLoader.VERSION = '3.14';

Libraries

GoogleMapsLoader.LIBRARIES = ['geometry', 'places'];

Localization

GoogleMapsLoader.LANGUAGE = 'fr';

Region

GoogleMapsLoader.REGION = 'GB';

Unload google api

For testing purposes is good to remove all google objects and restore loader to its original state.

GoogleMapsLoader.release(function() {
	console.log('No google maps api around');
});

Events

onLoad

GoogleMapsLoader.onLoad(function(google) {
	console.log('I just loaded google maps api');
});

Tests

$ npm test

Changelog list

  • 3.2.1

    • Typo in readme
  • 3.2.0

    • Removed support for SENSOR parameter #34
    • Add support for REGION parameter #36
    • Removed deprecated promises API #24
    • Fix some testing cases #23
    • Typo in readme #22
  • 3.1.0

    • Fix mock google maps loader
    • Add language parameter #17
    • Fix typos at readme #19
    • Fix for IE 8 #21
    • Rename repository to Js-GoogleMapsLoader #15
  • 3.0.0

    • Register to bower registry
    • Moved to Carrooi organization
    • Using mocked loader, so tests are much faster
    • Optimized building request url
    • Some variables and methods are now private and not accessible from outside
    • Updated dependencies
    • Whole package is written in javascript, not coffeescript
  • 2.1.1

    • Sh**.... Forgot to increase version at package.json
  • 2.1.0

    • Added support for libraries #3 (thanks popara)
    • Added tests
    • Small optimization
  • 2.0.0

    • Added Maps API for Business support
    • Added standalone version for non common js environments
    • Removed dependency on q package
    • Using callback instead of promise
    • Added tests + travis
    • Added status badges
  • 1.0.0

    • Initial version

js-googlemapsloader's People

Contributors

davidkudera avatar msikma avatar hollandmatt avatar thecotne avatar scriptist avatar sasknot avatar sambernard avatar rufman avatar

Watchers

James Cloos avatar Rickie Anand avatar

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.