Giter Club home page Giter Club logo

googlemapsaddon's People

Contributors

flowingcodeci avatar javier-godoy avatar mlopezfc avatar ngonzalezpazfc avatar paodb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

googlemapsaddon's Issues

Setting of anchorpoint for Markers

From what I have found there is currently no way to define the anchorpoint of a Marker and it currently always is the bottom center of the marker image.
Would there be a way to work around this or implement it? Setting the anchor points would enable to for example create directional markers like this.

Bildschirmfoto vom 2024-02-05 11-37-09

Or is there any other way to draw the heading/direction of a Marker?

Prevent Google Maps V3 loading Roboto font

Hi,

I've noticed that, after map was shown, application font would be changed (this includes complete Vaadin view where map is shown). The cause looks like is due to Google Maps API loading Roboto font automatically as explained here [1].

For me, the fix was applying [2] js hack. Maybe there is a better way to handle this from addon or addong could call [2] automatically.

[1] https://stackoverflow.com/questions/25523806/google-maps-v3-prevent-api-from-loading-roboto-font
[2] https://stackoverflow.com/a/74852333

Add DomEvent for google-map-marker-dragend marker event

There was this question on directory:

I would like to know how to retrieve the new (after dragend) LAT and LON values since I cannot retrieve them with the following.

addMarker.setDraggable(true);
addMarker.getElement().setProperty("dragEvents", true);
addMarker.getElement().addEventListener("google-map-marker-dragend", l -> {
Notification.show(addMarker.getPosition().toString());
});

The listener does fire but I get the old LON and LAT results.

I made it work like this:

addMarker.setDraggable(true);
addMarker.getElement().setProperty("dragEvents", true);
addMarker.getElement().addEventListener("google-map-marker-dragend", event -> {
        JsonObject eventData = event.getEventData();
        JsonObject latLng = eventData.getObject("event.detail.latLng");
        Notification.show("Lat: " + latLng.getNumber("lat") + " - Lng: " + latLng.getNumber("lng"));
      }).addEventData("event.detail.latLng");

But I think it will be a better idea to define a DomEvent for "google-map-marker-dragend" event in GoogleMapMarker class so the call to get the new position is simplified by just adding a listener.

No Google Maps API Key or Client ID specified

When we checkout out our project to a clean directory, build and deploy, we are getting:
This page can't load Google Maps correctly.
Do you own this website?”, error over the map.

Looking in the console, there is a message “No Google Maps API Key or Client ID specified.” Error.
During the build process of the project, there is a warning:
?babel-target=es5 473:11-16
"export 'default' (imported as 'equal') was not found in 'fast-deep-equal' @ ../node_modules/@flowingcode/google-map/google-map.js?babel-target=es5

This had all worked before. We didn't make any changes to the mapping code.

Don't know but this could be related to the same problem Vaadin had with bable package here:
vaadin/flow#16905

The @babel/plugin-proposal-object-rest-spread was renamed to plugin-transform-object-rest-spread
which required them to rev from 14.8.0 to 14.10.1

In any case, it appears the API Key is not being sent. google-maps version: 1.8.3

Marker does not appear if maps component in a separate tab

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.

error implementing GoogleMap gmaps = new GoogleMap(apiKey, null, null);

al intentar implementar el constructor me sale el siguiente error:

GoogleMap gmaps = new GoogleMap(apiKey,null,null);
gmaps.setMapType(MapType.SATELLITE);
gmaps.setSizeFull();
gmaps.setCenter(new LatLon(0,0));
gmaps.addMarker("Center", new LatLon(0,0), true, "");
GoogleMapPolygon gmp = gmaps.addPolygon(Arrays.asList(new GoogleMapPoint(gmaps.getCenter()),
new GoogleMapPoint(gmaps.getCenter().getLat(),gmaps.getCenter().getLon()+1),
new GoogleMapPoint(gmaps.getCenter().getLat()+1,gmaps.getCenter().getLon())));

error:
java.lang.NoClassDefFoundError: com/flowingcode/vaadin/addons/googlemaps/GoogleMap
at application.views.proyectos.General.(General.java:86) ~[classes/:na]
at application.views.proyectos.Proyecto.setContenidoTab(Proyecto.java:61) ~[classes/:na]
at application.views.proyectos.Proyecto.lambda$0(Proyecto.java:49) ~[classes/:na]
at com.vaadin.flow.component.ComponentEventBus.fireEventForListener(ComponentEventBus.java:206) ~[flow-server-9.0.1.jar:9.0.1]
at com.vaadin.flow.component.ComponentEventBus.fireEvent(ComponentEventBus.java:195) ~[flow-server-9.0.1.jar:9.0.1]
at com.vaadin.flow.component.Component.fireEvent(Component.java:378) ~[flow-server-9.0.1.jar:9.0.1]
at com.vaadin.flow.component.tabs.Tabs.updateSelectedTab(Tabs.java:488) ~[vaadin-tabs-flow-22.0.1.jar:na]
at com.vaadin.flow.component.tabs.Tabs.lambda$new$c53a20e4$1(Tabs.java:77) ~[vaadin-tabs-flow-22.0.1.jar:na]
at com.vaadin.flow.internal.nodefeature.ElementPropertyMap.lambda$fireEvent$2(ElementPropertyMap.java:465) ~[flow-server-9.0.1.jar:9.0.1]
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) ~[na:na]
at com.vaadin.flow.internal.nodefeature.ElementPropertyMap.fireEvent(ElementPropertyMap.java:465) ~[flow-server-9.0.1.jar:9.0.1]
at com.vaadin.flow.internal.nodefeature.ElementPropertyMap.access$100(ElementPropertyMap.java:49) ~[flow-server-9.0.1.jar:9.0.1]
at com.vaadin.flow.internal.nodefeature.ElementPropertyMap$PutResult.run(ElementPropertyMap.java:170) ~[flow-server-9.0.1.jar:9.0.1]
at com.vaadin.flow.server.communication.ServerRpcHandler.runMapSyncTask(ServerRpcHandler.java:424) ~[flow-server-9.0.1.jar:9.0.1]
at com.vaadin.flow.server.communication.ServerRpcHandler.lambda$handleInvocations$0(ServerRpcHandler.java:418) ~[flow-server-9.0.1.jar:9.0.1]
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) ~[na:na]
at com.vaadin.flow.server.communication.ServerRpcHandler.handleInvocations(ServerRpcHandler.java:418) ~[flow-server-9.0.1.jar:9.0.1]
at com.vaadin.flow.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:320) ~[flow-server-9.0.1.jar:9.0.1]
at com.vaadin.flow.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:115) ~[flow-server-9.0.1.jar:9.0.1]
at com.vaadin.flow.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40) ~[flow-server-9.0.1.jar:9.0.1]
at com.vaadin.flow.server.VaadinService.handleRequest(VaadinService.java:1567) ~[flow-server-9.0.1.jar:9.0.1]
at com.vaadin.flow.server.VaadinServlet.service(VaadinServlet.java:299) ~[flow-server-9.0.1.jar:9.0.1]
at com.vaadin.flow.spring.SpringServlet.service(SpringServlet.java:109) ~[vaadin-spring-19.0.2.jar:na]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:764) ~[tomcat-embed-core-9.0.52.jar:4.0.FR]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:711) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:459) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:353) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:313) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.springframework.web.servlet.mvc.ServletForwardingController.handleRequestInternal(ServletForwardingController.java:141) ~[spring-webmvc-5.3.9.jar:5.3.9]
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:177) ~[spring-webmvc-5.3.9.jar:5.3.9]
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:51) ~[spring-webmvc-5.3.9.jar:5.3.9]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1064) ~[spring-webmvc-5.3.9.jar:5.3.9]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963) ~[spring-webmvc-5.3.9.jar:5.3.9]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.3.9.jar:5.3.9]
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) ~[spring-webmvc-5.3.9.jar:5.3.9]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:681) ~[tomcat-embed-core-9.0.52.jar:4.0.FR]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.3.9.jar:5.3.9]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:764) ~[tomcat-embed-core-9.0.52.jar:4.0.FR]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.52.jar:9.0.52]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:327) ~[spring-security-web-5.5.2.jar:5.5.2]
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:115) ~[spring-security-web-5.5.2.jar:5.5.2]
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:81) ~[spring-security-web-5.5.2.jar:5.5.2]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:121) ~[spring-security-web-5.5.2.jar:5.5.2]
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:115) ~[spring-security-web-5.5.2.jar:5.5.2]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:126) ~[spring-security-web-5.5.2.jar:5.5.2]
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:81) ~[spring-security-web-5.5.2.jar:5.5.2]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:105) ~[spring-security-web-5.5.2.jar:5.5.2]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:149) ~[spring-security-web-5.5.2.jar:5.5.2]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) ~[spring-security-web-5.5.2.jar:5.5.2]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:218) ~[spring-security-web-5.5.2.jar:5.5.2]
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:212) ~[spring-security-web-5.5.2.jar:5.5.2]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:103) ~[spring-security-web-5.5.2.jar:5.5.2]
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:89) ~[spring-security-web-5.5.2.jar:5.5.2]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
at org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:117) ~[spring-security-web-5.5.2.jar:5.5.2]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.9.jar:5.3.9]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90) ~[spring-security-web-5.5.2.jar:5.5.2]
at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75) ~[spring-security-web-5.5.2.jar:5.5.2]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.9.jar:5.3.9]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:110) ~[spring-security-web-5.5.2.jar:5.5.2]
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:80) ~[spring-security-web-5.5.2.jar:5.5.2]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:55) ~[spring-security-web-5.5.2.jar:5.5.2]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.9.jar:5.3.9]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:211) ~[spring-security-web-5.5.2.jar:5.5.2]
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:183) ~[spring-security-web-5.5.2.jar:5.5.2]
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:358) ~[spring-web-5.3.9.jar:5.3.9]
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:271) ~[spring-web-5.3.9.jar:5.3.9]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.3.9.jar:5.3.9]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.9.jar:5.3.9]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.3.9.jar:5.3.9]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.9.jar:5.3.9]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.3.9.jar:5.3.9]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.9.jar:5.3.9]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:382) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1726) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]
Caused by: java.lang.ClassNotFoundException: com.flowingcode.vaadin.addons.googlemaps.GoogleMap
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) ~[na:na]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) ~[na:na]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[na:na]
at java.base/java.lang.Class.forName0(Native Method) ~[na:na]
at java.base/java.lang.Class.forName(Class.java:398) ~[na:na]
at org.springframework.boot.devtools.restart.classloader.RestartClassLoader.loadClass(RestartClassLoader.java:145) ~[spring-boot-devtools-2.5.4.jar:2.5.4]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[na:na]
... 114 common frames omitted

Client side geolocation handling

From directory:

"I wonder if there is a way of handling client side geolocation in order to set the center of the map according to the users location?"

Get coordinate bounds.

Hey! Love the addon, super helpful for Vaadin 14 usage. I was wondering if it was possible to either listen for the bounds_changed event in google's maps api and then, using the getBounds() function, return the two coordinate bounds. I want to implement a functionality so I can see all the markers that are currently visible into my app. Is this possible to get added or is there some javascript events I can listen to?

I was doing some poking around inside of the source and was only able to listen to drag events, not much success.

Markers: animationEnabled and optimized properties questions

This two properties have no effect on markers when set to true.

  • animationEnabled: property on google-map web-component is called animation and it expects a String that represents the type or animation. It has this comment: "A animation for the marker. "DROP" or "BOUNCE". See https://developers.google.com/maps/documentation/javascript/examples/marker-animations." In that example you can see that it needs to recibe an animation type. So my question is, what was the idea behind animationEnabled property on GoogleMapMarker class?
  • optimized: I didn't find any property with that name on the web-component. The JavaDoc says "Enables/disables marker optimization. If enabled, many markers are rendered as a single static element. Disable if you want to use animated GIFs or PNGs." but is doing when enabled. So, is this property supposed to exist on google-map? What it should do?

Geocoding support

The question of whether the component supports geocoding (search addresses and get coordinates) has been asked twice on the directory, so I'm creating this ticket to discuss if it is possible to add the feature to our current component. The primary set back is that the Geocoding API is billed.

removeMarker when clustering enabled not working

GoogleMapMarker doesen't seem to be removed from the map, when clustering is enabled.

The markers which are not gathered in any cluster are removed correctly but the rest are left on the map. You can't call the remove method again after the initial attempt with the exception:

java.lang.IllegalArgumentException: Child should have this element as a parent

Map not rendering and error thrown in browser console

When using the Google Maps Addon widget, the map is not shown and an exception is being thrown to the console of the browser.

The visualization in the browser:
image

The following error is being shown in the console:
image

This problem also occurs on the online demo of the Vaadin addon at https://addonsv14.flowingcode.com/googlemaps

Platform versions:
Google Maps Addon version: 1.6.0
Vaadin version: 14.8.4

Verified in:
Chrome: 98.0.4758.82
Firefox: 97.0 (64-bit)

No map display, no any errors in any consoles

Vaadin: 24.1.4
Flow: 24.1.5
Java: Oracle Corporation 19.0.2
OS: x86_64 Mac OS X 13.4.1
Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36
Live reload: Java active (Spring Boot Devtools): Front end active

Browser console log, attached.
localhost
Screen shot
GoogleMapsView

Marker is not being shown if it is added after map was added to its container

This comes from directory:

"I have to add the GoogleMap object to its container last. Any other place in the code no GoogleMapMarker are shown at first show of the map (I had to remove and add them again)."

It should be possible to add a marker after the map is added to the container.

Example to reproduce this:

      GoogleMap gmaps = new GoogleMap(apiKey, null, null);
      gmaps.setMapType(MapType.ROADMAP);
      gmaps.setCenter(new LatLon(-31.636036, -60.7055271));
      gmaps.setSizeFull();     
      add(gmaps);
      gmaps.addMarker(
          new GoogleMapMarker("You are here!", gmaps.getCenter(), false, Markers.GREEN));

Add a way to disable/enable google map controls

After this PR FlowingCode/google-map#11 in the googlemaps web-component to add a way to disable "Rotate Control", it came to my attention that there's no api to disable that control or any other control on this component. So this ticket is to add a way to disable/enable the following controls:

  • Rotate Control
  • Street View Control
  • Map Type Control
  • Full Screen Control
  • Zoom Control
  • Scale Control

More on controls: https://developers.google.com/maps/documentation/javascript/controls#ControlsOverview

Info window doesn't work

From directory:

I face a problem: I use a marker but I can't show the info window on both cases:

when a click on it,
or through setInfoWindowVisible() method
I can reproduce it on your official demo: changing tab from 'Google Maps Demo' to another one (e.g. 'Add Markers Demo') and then back again to 'Google Maps Demo', when I do click on the marker the info window does not appear again (neither the icons on the polygon).

Obtaining the right google api key

Thanks for this project. I'd like to explore the use of Google maps in my application based on Spring Boot framework and Vaadin. I've not used Google maps API but as I explore and read about it it seems like there are a lot options and I want to avoid going down any rabbit wholes.

Please offer some guidance on what I need to look for in order to explore your project on my own? What "product" and or "project" I should be signing up for?

And then, where is the "-D option set?

Any further directions one how to use the site to get the right key would be greatly appreciated.

Thanks

Implement drag listener on map

I have to add markers programmatically when the users drag the map. Is possible to implement the drag listener of the map to achieve this?
Thank you!

Error when adding markers to map

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

Add mouse click event

Add mouse click event on the map. The event could be used to retrieve the map coordinates.

Demo: refactor GoogleMapsDemo class

GoogleMapsDemo class contains a lot of examples/code on how to use most of the add-ons features. File have become hard to follow so it would be better if each feature could have it's own demo on it's very own tab.

Issue when adding markers

Apparently there is an issue with adding markers on the map because it seems that when trying to add a marker on the map that is different to the gmaps.getCenter() the marker will not be added.

For example:

Button addMarker = new Button("Add Marker", ev -> {
				this.gmaps.addMarker("New Marker", this.gmaps.getCenter(), true, "");
});

will add a marker on the map while

Button addMarker = new Button("Add Marker", ev -> {
				this.gmaps.addMarker("New Marker", new LatLon(12.00d, 22.00d), true, "");
});

will not add it.

Marker is not draggable

This issue comes from Directory:

"I can see that marker has draggable property by default. But I can not drag the marker on the map. Even the marker on the demo is not draggable even though the draggable parameter is set to true. How to enable the draggable feature for the marker? Thanks"

I did a quick test and indeed, marker is not dragging even thought the flag is set to true.

right click on marker

Hello,
in version 1.6.0
I can't get right click event over marker
(left click is working, but does not give me clickCounts, ctrl, shift, and alt keys)

best regards

Compilation error / Vaadin 24.0.0.beta1

Error:  GoogleMapsAddon/src/test/java/com/flowingcode/vaadin/addons/googlemaps/AddMarkersDemo.java:[59,12] cannot find symbol
  symbol:   method setDataProvider(com.vaadin.flow.data.provider.ListDataProvider<java.lang.String>)
  location: variable colorCB of type com.vaadin.flow.component.combobox.ComboBox<java.lang.String>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.