Ember Map provides you with google-map and yandex-map components.
JavaScript HTML
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
addon
app/components
config
public
tests
vendor
.bowerrc
.ember-cli
.gitignore
.jshintrc
.travis.yml
Brocfile.js
README.md
bower.json
index.js
package.json
testem.json

README.md

Ember Map

Build Status npm version

Ember Map provides you with google-map and yandex-map components.

Add Maps Libraries

To use google apiKey you need to set it in config/environment.js.

ENV['ember-cli-map'] = {
  googleApiKey: 'MYsecretKEY'
};

Model Setup

Declare fields to use with map component:

asGoogleMap: ['lat', 'long', 'zoom'] // or
asYandexMap: ['lat', 'long', 'zoom']

###Example:

export default DS.Model.extend({
    lat:       DS.attr('number'),
    long:      DS.attr('number'),
    zoom:      DS.attr('number'),
    asGoogleMap: ['lat', 'long', 'zoom']
});

#In your template

{{google-map model=model action='updateModel'}}
{{yandex-map model=model action='updateModel'}}

#In your route/controller

actions: {
  updateModel(newCoordinates) {
    this.get('currentModel').setProperties(newCoordinates);
  }
}

License

[Licensed under MIT license] 1