-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible to do KML layers? #50
Comments
so yeah, we don't have support for that feature yet, but you can do it in some hacky way with custom "functional" components: {{#g-map lat=lat lng=lng zoom=13 as |mapContext|
{{your-kml-component map=mapContext.map kmlUrl="http://example.com/layer.kml}}
{{/g-map}} and then import Ember from 'ember';
export default Ember.Component.extend({
init() {
this._super(...arguments);
this.setKmlLayer();
},
mapHasBeenSet: Ember.observer('map', function() {
Ember.run.once(this, 'setKmlLayer');
}),
setKmlLayer() {
const map = this.get('map');
const url = this.get('kmlUrl');
if (Ember.isPresent(map) && Ember.isPresent(url)) {
const layer = new google.maps.KmlLayer({ url, map });
this.set('layer', layer);
}
}
}); |
also looks like this feature could be added really easy, so if you can make it work maybe you can consider contributing to the project by adding |
@asennikov Great, thanks for the tip. I will give it a try and see how I go. |
I'm wondering how to do KML layers using this addon?
https://developers.google.com/maps/documentation/javascript/examples/layer-kml
Perhaps using just some plaun javascript for now?
The text was updated successfully, but these errors were encountered: