-
Notifications
You must be signed in to change notification settings - Fork 7
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
Marker does not appear if maps component in a separate tab #49
Comments
Hello. If the component is in another tab, it will be reattached when the tab is shown, which may causes some issues. We'll investigate the case. |
Hi @ijazfx can you tell me which version of the component you're using? Thanks. |
Hi @paodb I'm using 1.3.0 maven dependency. |
Hi @ijazfx. Regarding the markers location on drag end, we're adding the DragEndEvent in our next release (see #40). Meanwhile you can achieve it like this:
We'll investigate the tabs issue and get back to you. |
Hi again @ijazfx. I did a simple example trying to replicate the behavior you mentioned about marker not showing when map is displayed on tab selection. I have two tabs and two maps with markers, when I navigate through the tabs, maps & markers are showing correctly:
Is your implementation somehow similar? if not, can you share an example that reproduces your issue? Regards. |
Hi @paodb Here is simple code: `package com.xyz.abc; import com.flowingcode.vaadin.addons.googlemaps.GoogleMap; public class GoogleMapComponent extends VerticalLayout {
} The setLocation(...) method is called from the parent component when tab is changed. If I uncomment the code of setLocation(...) following happens: Now if I zoom out, the marker is still at the old location, although setLocation changed map center and zoom, but it couldn't update marker location. Also if I create a marker in setLocation(...) as follows: `public class GoogleMapComponent extends VerticalLayout {
}` Following is the output: And with the same code when I select another tab and then come back to maps tab I see the marker: I hope this will help understand the issue I'm facing. Thanks. |
Hi @ijazfx, first of all, please take in consideration that today we made a new release with some fixes, new version is 1.4.0. There was a bug on I'm still trying to figured out what's wrong with your second example, I was able to reproduce it but not sure why marker is not rendered the first time when adding it in your setLocation method. |
Thanks @paodb, version 1.4.0 is helpful and thank you for introducing marker drag event. |
Hi @ijazfx there's a new released version of the addon, version 1.6.0. Could you give it a try? The issue with the marker should be fix now. |
I'm facing a weird issue. I've create a component which has a tab to show Google Map with marker details.
The issue is when I select the tab to show map, it does not show the marker. But if I create a button on the same tab and explicitly add the marker, it shows.
Seems like there is some synchronization issue. Pls advise.
The text was updated successfully, but these errors were encountered: