google maps vadin 10+ (vaadin 14)

Hello everyone,
I’m interested in putting a google map on vaadin 14 (in a pwa)
I have seen that there are many addons for vaadin 8 obviously not working with 10+
looking around I have not found anything and then I ask you if there is any addon already ready?
I also saw the webcomponent (https://vaadin.com/directory/component/googlewebcomponentsgoogle-map)
I have never touched the world of polymer only java, I was wondering if I wanted to use it how to start using it in a vaadin 14 UI, a small demo or example if possible, I searched in the vaadin guides but I didn’t understand much.

thank you all

Hi, there is an implementation of google maps add on and web component to vaadin 14 see this [reply]
(https://vaadin.com/forum/thread/18150652/18153769). We must publish in the directory soon

Johny Ortega:
Hi, there is an implementation of google maps add on and web component to vaadin 14 see this [reply]
(https://vaadin.com/forum/thread/18150652/18153769). We must publish in the directory soon

fantastic, i have a question

I tried the demo works perfectly, now I was trying to use it in my project (war java plain) when I try to use it in the ui it doesn’t come out (always white)
a simple label sees it without problems so I don’t think they are writing problems, I also tried to change the version of vaadin since I was using 14.1 (even with version 14.0 nothing) do I have to import anything in particular? or does it really need spring to work?

Hi, You can use in Plain Java Servlet or CDI and JEE technology stack.
Using a Plain Java Servlet empty project

  • add the dependency in the pom.xml
  • add the code to the main view
  • and run clean and build or package

pom.xml (local dependency, the add-on are not available in the add-on directory)

<dependency>
    <groupId>com.neotropic.vaadin14.component</groupId>
    <artifactId>google-map-flow</artifactId>
    <version>1.0-SNAPSHOT</version>
    <type>jar</type>
</dependency>

MainView.java

public class MainView extends VerticalLayout {

    public MainView() {
        setSizeFull();
        GoogleMap googleMap = new GoogleMap("[API-KEY]
", "[CLIENT-ID]
");
        add(googleMap);
    }
}

Johny Ortega:
Hi, You can use in Plain Java Servlet or CDI and JEE technology stack.
Using a Plain Java Servlet empty project

  • add the dependency in the pom.xml
  • add the code to the main view
  • and run clean and build or package

pom.xml (local dependency, the add-on are not available in the add-on directory)

<dependency>
    <groupId>com.neotropic.vaadin14.component</groupId>
    <artifactId>google-map-flow</artifactId>
    <version>1.0-SNAPSHOT</version>
    <type>jar</type>
</dependency>

MainView.java

public class MainView extends VerticalLayout {

    public MainView() {
        setSizeFull();
        GoogleMap googleMap = new GoogleMap("[API-KEY]

", "[CLIENT-ID]
");

    add(googleMap);
}

}

fantastic,

right now i am looking for a method to receive the user’s gps location, i tried with the addon (https://vaadin.com/directory/component/geo-location-addon/api/org/vaadin/elmot/flow/ sensors / GeoLocation.html) but it doesn’t seem to work on the versions after 13 of vaadin (on the 13 I tried it works) would you know how to proceed to make it work on the 14 or do you have a method for this too? meanwhile, thank you

Hi [here]
(https://vaadin.com/forum/thread/18190988/18194055) you can find an approach to get the geolocation in vaadin. And I add this feature in my google maps add-on to-do list

Johny Ortega:
Hi [here]
(https://vaadin.com/forum/thread/18190988/18194055) you can find an approach to get the geolocation in vaadin. And I add this feature in my google maps add-on to-do list

if you add this feature please tell me :smiley: