flowingcode / googlemapsaddon Goto Github PK
View Code? Open in Web Editor NEWVaadin Addon based on Google Maps Web Component
Home Page: https://www.flowingcode.com/en/open-source/
License: Apache License 2.0
Vaadin Addon based on Google Maps Web Component
Home Page: https://www.flowingcode.com/en/open-source/
License: Apache License 2.0
It was decided on #43 (comment) to remove the option as it doesn't exists in the web component part and it does nothing when enabled.
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.
Or is there any other way to draw the heading/direction of a Marker?
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
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.
This library is very good.
Would it be possible to use the setTilt and setHeading function to rotate the map?
https://developers.google.com/maps/documentation/javascript/examples/webgl/webgl-tilt-rotation
I thought about accessing the map via javascript, but I'm not getting it, if anyone has any ideas.
Analyze the request of adding custom content in a marker, such as directions, custom html, etc.
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
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.
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
Similar to
but for markers with DomEvent = google-map-marker-click.The following was asked in Vaadin's directory:
Hello, is it possible to change color at markers?
It would be nice to implement this feature.
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?"
This comes from directory:
Is there a way to set the controls size? Here is a SO answer on how it can be set.
https://stackoverflow.com/a/68389696/1490322
I notice that the controls buttons look a bit big by default. Thanks
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.
This two properties have no effect on markers when set to true.
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
The Info close button is not visible.
If you click where it normally is, it works, but it's transparent.
The following was reported in Vaadin's directory:
Hello , I have following problem: I create map with marker then I navigate to other pages in app and then when I return to the page with map marker disapears.
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:
The following error is being shown in the console:
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)
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
Hi,
Can You change implementation for click event on GoogleMapPolygon to implemenation like in GoogleMap. I need lat/lng position.
Regards
Drawing Arrows on a map is described in the Google Maps Documentation.
It makes use of Google Maps Symbols by adding them to the icon
-property of the Polyline
.
The javascript code in google-map-poly.js already contains the icons
-property, however I could not find this covered by the Java implementation GoogleMapPolygon.java.
I ask to consider this enhancement idea in a future version of the addon.
Thank you!
I would like to show the markers as cluster for performance reason:
https://developers.google.com/maps/documentation/javascript/marker-clustering
Would it be hard to use this to group the marker?
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));
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:
More on controls: https://developers.google.com/maps/documentation/javascript/controls#ControlsOverview
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).
Analyze the possibility of enabling drawing tools in the map.
Google Maps allows us to style our maps with unique mapId. Once the style is defined, we can pass that to maps component. PFB link for details.
It would be good to add support for adding KML layers
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
Currently there are 3 different demo classes regarding markers, maybe it is a good idea to unite these 3 demos in a single one.
The 3 demos are:
It seems like clustering only works, when picking the "default" markers. If specifying a marker URL for the image, clustering doesn't seem to work ...
When trying to set this properties to a marker by using setter methods defined in GoogleMapMarkers class, client side values are not updated so nothing happens.
Setters and getters should set/get the element properties as in GoogleMapPolygon class.
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!
Right now, InfoWindows are attached to Markers but it will be a nice feature to be able to display InfoWindows in a specific location without depending on having a Marker. See: https://developers.google.com/maps/documentation/javascript/infowindows#add
Add mouse click event on the map. The event could be used to retrieve the map coordinates.
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.
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.
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.
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
When I'm trying to use this addon in a sample project in Vaadin 23.2 with Vite.
I have this error:
Failed to execute 'define' on 'CustomElementRegistry': the name "dom-module" has already been used with this registry
I didn't see a Vaadin 23 branch.
Here is an example: https://github.com/jcgueriaud1/googlemap-v23-issue
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>
Depends on FlowingCode/google-map#29
It would be great to add support for adding lines besides what is currently supported by method addPolygon()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.