Comments (4)
@borisrorsvort if I understood correctly you want to update the map's dimensions when the window resizes.
The best way to do that would be to extend the leaflet-map component with the ResizeAware
mixin.
Example:
import LeafletMapComponent from 'ember-leaflet/components/leaflet-map';
import ResizeAware from 'ember-resize/mixins/resize-aware';
export default LeafletMapComponent.extend(ResizeAware, {
debouncedDidResize() {
if (this._layer) {
this._layer.invalidateSize();
}
}
});
this._layer
is the raw instance of the leaflet map layer. More info on the invalidateSize()
method: http://leafletjs.com/reference.html#map-invalidatesize
Feel free to reopen/comment if this didn't help you. :)
from ember-leaflet.
I didn't know you could do this :) I'll try that. Thanks!
from ember-leaflet.
👍 that worked! Thanks 😄
from ember-leaflet.
i think i am having the same problem , where to put that mixin? in initializers ?
from ember-leaflet.
Related Issues (20)
- marker.popup doesn't see close element HOT 1
- closePopupOnClick does not work with a flag HOT 1
- Uncaught Error: Could not find module `ember-get-config` imported from `(require)` HOT 8
- Options to geojson not passed HOT 2
- [docs] links/version HOT 2
- Deprecated use of `assign`
- Issue going from v.4.1.1 to 5.0.0. leafletProperties is removed from BaseLayer. HOT 1
- NPE: TypeError: this.L.latLng is not a function in fastboot HOT 1
- Deprecation - ensure-safe-component.string HOT 4
- Error on cleanup
- Breaking changes using leaflet `1.8.0` HOT 3
- Uncaught Error: Assertion Failed: The `element` helper polyfill encountered an unexpected error HOT 2
- Dynamically setting bounds errors asynchronously in test HOT 1
- Help needed with an Embroider error HOT 2
- Ember 5.x+ Support HOT 2
- FastBoot issue
- Adding custom options to Wms-Tile? HOT 3
- Example of how to use divIcon HOT 4
- Documentatiojn for @popupOpen? HOT 1
- Initially set bounds on set of points
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-leaflet.