-
Notifications
You must be signed in to change notification settings - Fork 87
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
export Leaflet object, public components and toLatLng macro #141
export Leaflet object, public components and toLatLng macro #141
Conversation
@buschtoens I think the way forward would be to import L from 'leaflet'; directly. However, es6 imports from npm modules with ember-cli doesn't seem to be very easy at the moment. A snippet from react-leaflet: import { Map, Marker, Popup, TileLayer } from 'react-leaflet'; Would you mind changing index.js to export all leaflet layers + |
903b461
to
9f9a59b
Compare
I've exported all classes listed in the reference. |
@buschtoens there was a communication error, I think. |
Sorry. 😅
I'll fix that tomorrow.
…On Thu, Mar 23, 2017, 20:15 Miguel Andrade ***@***.***> wrote:
@buschtoens <https://github.com/buschtoens> there was a communication
error, I think.
I was asking to export all the *ember-leaflet* classes, not the leaflet
ones. Those can be found in the leaflet package.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#141 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAy8TINgEBqwBxcqJoDQNbJGtIB9m6dmks5rosS8gaJpZM4MmYVs>
.
|
Just for clarification: Which files do you want exported?
And what would be the benefit? Couldn't they be imported like so? import BaseLayerComponent from 'ember-leaflet/components/base-layer';
import { latLngBounds } from 'ember-leaflet/helpers/lat-lng-bounds';
import toLatLng from 'ember-leaflet/macros/to-lat-lng';
import DraggabilityMixin from 'ember-leaflet/mixins/draggability'; Or is this merely for easier access? |
Let's start with public-ish things. Components:
I don't see a need to export helpers here. They're basically useless outside of templates. The user could just use the
Well, yes, at the moment they would be just for easier access because ember-cli doesn't have a way for addons to have private components.
We should use es6 reexport shorthand like so: export { default as CircleLayer } from 'ember-leaflet/components/circle-layer';
export { default as CircleMarkerLayer } from 'ember-leaflet/components/circle-marker-layer';
export { default as GeojsonLayer } from 'ember-leaflet/components/geojson-layer';
// ... |
9f9a59b
to
544c45b
Compare
544c45b
to
e0fe57b
Compare
Done. 🏁 Changelog has been amended. 📝 |
addon/index.js
Outdated
@@ -0,0 +1,30 @@ | |||
const L = window.L || {}; | |||
|
|||
export default L; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't feel enough confidence to use the default
export yet.
It would make sense for the leaflet package itself, but we may want to use this export for something else later?
addon/index.js
Outdated
|
||
export { default as CircleMarkerLayer } from 'ember-leaflet/components/circle-marker-layer'; | ||
|
||
export { default as GeojsonLayer } from 'ember-leaflet/components/geo-json-layer'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
geo-json-layer
file doesn't exist.
e0fe57b
to
8e75083
Compare
|
🎉 |
Accessing the Leaflet object (
L
) is currently only possible like so:Whereas this PR enables importing Leaflet from the addon package.
When #106 lands this obviously would need adaption.