Directory

← Back

Google Maps Addon

Vaadin Flow add-on for Google Maps Web Component

Author

Rating

Popularity

700+

This add-on provides a simple wrapper around Google Maps web component.

Currently supported features:

  • Programmatic server-side panning and zooming
  • Adding/removing markers
  • Adding/removing polygons
  • Adding click listener to polygons
  • Show info window on markers
  • Geolocation
  • Add draggable markers
  • Define clustering for markers
  • Enable/disable UI controls
  • Define size of UI controls
  • Kml support
  • Tilt & rotation support
  • MapId support
  • Obtain map bounds & more

Sample code

            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())));
GoogleMapPolygon gmp = gmaps.addPolygon(Arrays.asList(
	    		new GoogleMapPoint(gmaps.getCenter().getLat(),gmaps.getCenter().getLon()+1),
	    		new GoogleMapPoint(gmaps.getCenter().getLat()+1,gmaps.getCenter().getLon()),
	    		new GoogleMapPoint(gmaps.getCenter().getLat(),gmaps.getCenter().getLon()-1),
					new GoogleMapPoint(gmaps.getCenter().getLat() - 1, gmaps.getCenter().getLon()),
					new GoogleMapPoint(gmaps.getCenter().getLat(), gmaps.getCenter().getLon() + 1)));
			gmp.setClosed(false);
			gmp.setIcons(new Icon("M -2,0 0,-2 2,0 0,2 z", "#F00", "#FF0", 1, 25));
			GoogleMapMarker flowingmarker = gmaps.addMarker("Center", new LatLon(-31.636036, -60.7055271), true,
					"https://www.flowingcode.com/wp-content/uploads/2020/06/FCMarker.png");
			flowingmarker.addInfoWindow("<h1>Flowing Code</h1>");

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

New features:

  • Add support for adding custom control buttons (#115)
  • Update API to allow setting properties to icons (#113)
  • Add possibility to track location (#117)

Bug fixes:

  • Update map after adding/removing polygons and polylines (#118)
Released
2024-04-15
Maturity
TESTED
License
Apache License 2.0

Compatibility

Framework
Vaadin 14+
Browser
Firefox
Safari
Google Chrome
iOS Browser
Android Browser
Microsoft Edge

Google Maps Addon - Vaadin Add-on Directory

Vaadin Flow add-on for Google Maps Web Component Google Maps Addon - Vaadin Add-on Directory
This add-on provides a simple wrapper around Google Maps web component. Currently supported features: * Programmatic server-side panning and zooming * Adding/removing markers * Adding/removing polygons * Adding click listener to polygons * Show info window on markers * Geolocation * Add draggable markers * Define clustering for markers * Enable/disable UI controls * Define size of UI controls * Kml support * Tilt & rotation support * MapId support * Obtain map bounds & more
Online