FlowingCode/GoogleMapsAddon

Error when adding markers to map

Closed this issue · 4 comments

ED-SD commented

Hello,

I integrated you very nice plugin to my Vaadin Application.

When I'm adding markers to the map, I get the attached error. The strange thing is, when I'm refresh the browser after getting the error it works.

Please let me know, If you need more informations.

Best regards,
Johannes
bug

Any news? we had the exact same issue...

ED-SD commented

Hi magnusahlden,

I solved the problem by adding the markers after loading the page. A very ugly solutions, but it works.

`// Start Polling when attaching this component
addAttachListener(attachEvent ->
{
if (pollListener.get()==null)
{
UI.getCurrent().setPollInterval(5000);

			Registration registration = UI.getCurrent().addPollListener(pollEvent -> {

ADD OR UPDATE MARKERS HERE
});

			pollListener.set(registration);
		}
	});

	// Stop Polling when detaching this component
	addDetachListener(detachEvent ->
	{
		if (pollListener.get()!=null)
		{
			UI.getCurrent().setPollInterval(-1);

			pollListener.get().remove();
			pollListener.set(null);
		}
	});

`

paodb commented

Hello @ED-SD, @magnusahlden. There's a new release of the component fixing this issue. Can you give it a try? Thanks.

Should be fixed in v1.2.1. Feel free to reopen this issue if it's not the case.