adaptive-googlemaps

Save data, conditionally load google maps.
Homepage:
1 person uses it
Submitted by: 840789? janantala

adaptive-googlemaps v0.1.2 Build Status

This module allows you to adapt googlemaps component for different occasions. - static google map - open map in a new tab / a native mobile application - load dynamic google map

Demo

Check out http://angular-adaptive.github.io/adaptive-googlemaps/demo/

Requirements

  • AngularJS v 1.0+
  • Googlemaps script

Usage

We use bower for dependency management. Add

To your bower.json file. Then run

This will copy the angular-isbn files into your bower_components folder, along with its dependencies. Load the script files in your application:

Add the adaptive.googlemaps module as a dependency to your application module:

Add googlemaps element into your template

Directive attributes

Required:

  • sensor="false" // true, false
  • size="500x300" // width x height
  • zoom="6"
  • center="California"

Optional:

  • markers="['San Francisco', 'San Jose']"
  • maptype="roadmap" // roadmap, satellite, terrain, hybrid
  • mapevents="{redirect: true, loadmap: false}"

mapevents: { "redirect": false, "loadmap": true }

Loads dynamic google map.

{ "redirect": true, "loadmap": false }

Opens google map in a new tab / a native mobile application.

mapevents: no mapevents

Nothing happens.

Contributing

Contributions are welcome. Please make a pull request against canary branch and do not bump versions. Also include tests.

Todo

  • Let the device/browser decide what kinds of map events will be used. Example: mobile device will open native maps application, browser with fast internet connection will auto load dynamic map...

Testing

More tests will be added...

We use karma and jshint to ensure the quality of the code. The easiest way to run these checks is to use grunt:

The karma task will try to open Chrome as a browser in which to run the tests. Make sure this is available or change the configuration in test/test.config.js

References

If you are looking just for static google maps you can use angular-google-staticmaps repository.

License

The MIT License

Copyright (c) 2013 Jan Antala, https://github.com/janantala

comments powered by Disqus
This page was last updated about 4 years ago.