Closed khenam closed 8 years ago
First impressions:
Hi, Thanks for answering,
Thanks again and waiting recommendations.
My suggestions:
<gmap-map>
<gmap-marker></gmap-marker>
</gmap-map>
and in fact I believe we want it to look that way, without having to deal with a common event bus. After all a <gmap-marker> will look very meaningless if it is not declared within a map object.
Hence, in lieu of Vue 1.x-style events or the Vue 2.x-style event bus, I think it is alright to disregard the strict independence of parent/children components in our case.
Which means,
var mapAncestor = this.$parent
while (!(mapAncestor instanceof Map)) {
mapAncestor = mapAncestor.$parent
if (mapAncestor.$parent === null) {
throw new Error("This component must be a child of a map!")
}
}
MapComponent
class (maybe it should be renamed to MapElement) so that you can avoid code duplication.if (this.destroyed) ...
checks should also be moved into MapComponent or DeferredReady.I think I found an intermediate solution to the issue of backward compatibility. Computed field reading the property on get and calling event on set. I modified the map to work this way. I'm modifying the others. After that I will modify the way of iteration of the map descendants as you suggest, it's really better.
<google-map
:center = "center"
:zoom="zoom"
@center_changed = "centerChanged"
></google-map>
Hi @xkjyeah, I did your recommendations, and remove the use of VueObjects. About TS i love it, but in this moment will be hard make this change because my deadline. In an other moment will be nice make this and add automated tests too. Waiting the analyses and thanks again your attention.
@xkjyeah Do you want fix this?
// FIXME: In version 1, we preserved the center of the map
https://github.com/xkjyeah/vue-google-maps/blob/vue2/src/components/map.vue#L87
@yisibl The way I envision vue-google-maps is for it to be a thin layer between Vue and Google Maps. This helps us avoid incompatibilities when either library is updated, and reduces number of surprises when users go from plain Google Maps to Vue.
Therefore, rather than change the semantics of resize()
, I would rather there be an alternative method (with a name like resizePreserveCenter()
) which does the centre-preserving resize. Would you like to make a PR?
(In any case, you will have to make a PR on vue2-google-maps, not on this repository which is vue-google-maps)
@xkjyeah Look forward to your update :joy:
No problem, i think change to resizePreserveCenter a good idea. But i don't know how make a PR to vue2-google-maps, maybe i need some help.
@yisibl I just published the latest version (0.3.0) which supports resizePreserveCenter()
.
Get it with npm install vue2-google-maps@latest
.
If you have any further feature requests, do file an issue there. I do not intend to make a pull request to vue-google-maps
because there is no way to simultaneously maintain support for both vue1 and vue2 in the same package, and I do not want to break vue-google-maps
's compatibility with Vue 1.x. (somewhere out there some user's application, possibly my own, is going to break if we do so).
@khenam Sorry about my parallel version. I saw your pull request only when I had already started my own port to Vue 2.x and had to make the port quickly for my own work.
Sorry @xkjyeah, I have difficult to compatibilize our branches. You change some concepts. Its better create a new branch in your repo and make this together? or wait i merge and send to you.
Do you know which features are missing in my repo? It might be easier to just merge in features that are missing / different.
I've published the API on Github. You can compare it with yours to see if anything is missing.
On Nov 21, 2016 19:43, "Ronald Lima" notifications@github.com wrote:
Sorry @xkjyeah https://github.com/xkjyeah, I have difficult to compatibilize our branches. You change some concepts. Its better create a new branch in your repo and make this together? or wait i merge and send to you.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/GuillaumeLeclerc/vue-google-maps/pull/112#issuecomment-261915515, or mute the thread https://github.com/notifications/unsubscribe-auth/ACiTR0nNM2tI1z-hhRpz1kVWjmxOWA8-ks5rAYPvgaJpZM4Kkh_i .
@xkjyeah Nice work, thank you 👻
Tranfer PR to @xkjyeah Repo https://github.com/xkjyeah/vue-google-maps/pull/2
All components are updated to be compatible with VueJs 2.0 All Properties with twoWay configuration are merged in a single object Objects to represent this components was created and com be used to create then