miguelcobain / ember-leaflet

:fire: :leaves: Easy and declarative mapping for ember

Home Page:https://miguelcobain.github.io/ember-leaflet/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Extending ImageLayer component

dev-zetta opened this issue · comments

Hello there,

I would like to extend the behaviour of ImageLayer component, but it seems that those components are not extendable.

import leaflet from 'ember-leaflet'
class GuiMapLayer extends leaflet.ImageLayer {
...
}

When used in template, {{#leaflet-map...
{{gui-map-layer url="..." }}

I get this error:

"Error: Assertion Failed: bounds is a required option but its value was undefined
at new EmberError (serve://dist/assets/vendor.js:18142:31)
at Object.assert (serve://dist/assets/vendor.js:17006:23)
at leafletRequiredOptions.forEach.optionName (serve://dist/assets/vendor.js:316575:51)
at Array.forEach ()
at GuiMapLayer. (serve://dist/assets/vendor.js:316574:30)
at ComputedProperty.get (serve://dist/assets/vendor.js:45815:36)
at _get (serve://dist/assets/vendor.js:44656:35)
at GuiMapLayer.get (serve://dist/assets/vendor.js:54162:34)
at GuiMapLayer.createLayer (serve://dist/assets/vendor.js:316787:42)
at GuiMapLayer.didInsertParent (serve://dist/assets/vendor.js:316517:26)"

I tried to specify the bounds explicitly, but I got the same error.

Edit: I need to override the getTileUrl method. If there is another way how to do that, I'd be glad for any hints.

@dev-zetta leaflet doesn't seem to have any ImageLayer, right?