Git Product home page Git Product logo

Comments (3)

asennikov avatar asennikov commented on June 27, 2024

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 your-kml-component component could be something like:

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);
    }
  }
});

from ember-g-map.

asennikov avatar asennikov commented on June 27, 2024

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 {{g-map-kml-layer}} component 😃

from ember-g-map.

mklnz avatar mklnz commented on June 27, 2024

@asennikov Great, thanks for the tip. I will give it a try and see how I go.

from ember-g-map.

Related Issues (20)

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.