0.0.14 • Published 7 years ago

angular-google-map-v2 v0.0.14

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

Update (2017)

Custom fork of this project to fix the directive name and add Google Marker icons to map

Angular Google Map

An angular directive to display a custom google map

Installation

Via NPM

$ npm install --save angular-google-map-v2

or the simple way, by including /dist/angular-google-map-v2.min.js into the head of your HTML.

Usage

Follow these steps to get it working in your project. In src you can see a working example of the module and play around with it. Alternatively, just follow these steps.

Adding to your Angular project

You can add the module as a dependency after declaring your own module, like so:

angular
    .module('myApp', ['angular-google-map-v2'])
    .config(config)
    .run(run);

The directive is now available to your app and can be used in your HTML.

HTML

To include the directive, use the following markup:

<google-map
    lat="51.507351"
    lng="-0.127758"
    apikey="YOUR-API-KEY-HERE"
</google-map>

Options

The Angular Google Maps directive works supports the majority of the style attributes that the native API supports. The only required properties are lat, long and zoom the others are optional. The following is a list of the supported attributes, which can all be added as attributes to the <google-map></google-map>

AttributeTypeRequiredDefaultDescription
apikeyStringTrueNONEYour Google maps API Key. You can obtain one easily from the website
latFloatTrueNONELatitude position for map
longFloatTrueNONELongitude position for map
clickable-iconsBooleanOptionalTrueLocations with more information are clickable
custom-cssStringOptional"height:400px;"Pass a CSS class to control the height, width and position of the map. Not setting a class will default the map to 400px high and 100% wide.
custom-map-nameStringOptionalN/AIf you pass in a custom map styling array, you can name it and make it selectable from from map styles control
custom-map-stylesArrayOptionalDefaultA custom map skin, see http://www.snazzymaps.com for examples
disable-default-uiBooleanOptionalFalseHide all controllable UI elements
disable-double-click-zoomBooleanOptionalTrueDouble clicking zooms in closer
draggableBooleanOptionalTrueSets wether the map can be moved by user dragging action
fullscreen-controlBooleanOptionalFalseDisplay a control to fullscreen the map
fullscreen-control-optionsBooleanOptional'TOP_LEFT'Position controls for the fullscreen map
map-typeStringOptional'ROADMAP'Choices are: 'ROADMAP','SATELLITE','HYBRID'
map-type-controlBooleanOptionalTrueDisplay the Map Type options buttons
map-type-control-options-styleStringOptional'HORIZONTAL_BAR'Style for the buttons. Choices are: 'HORIZONTAL_BAR' or 'DROPDOWN_MENU'
map-type-control-options-positionStringOptional'TOP_LEFT'Position of the buttons. Choices. See Full API for details
scrollwheelBooleanOptionalTrueIf False, use scrolling within the map will not effect zoom level.
street-view-controlBooleanOptionalTrueDisplay the Street View option
street-view-control-optionsBooleanOptional'RIGHT_BOTTOM'See Full API for details
zoomIntOptional8Default zoom level for map, the higher the number the closer the zoom
zoom-controlBooleanOptionalTrueDisplay the zoom control
zoom-control-optionsBooleanOptional'BOTTOM_RIGHT'See Full API for details

Support

This module has been developed to support versions of Angular from 1.2.2 up to 1.4.5 - If IE8 support is required please make sure to use Angular 1.2.

Browser Support

This module has been developed to support all modern browsers will providing legacy support for IE8 and up.

Development

If you wish to contribute or amend the source files and recompile you can do so by running the local development tasks.

You will need to install the dependencies by running npm install then run the default gulp task by running gulp. This will create a local server and run the uncompiled version of the assets. The files are then visible at: http://localhost:8001

Unit tests are still to be added.

Roadmap

  • Unit tests
0.0.14

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago