Lat × Long

Google Maps Web Components

This has been lurking in my feed reader for a while, but it’s still worth sharing: Google offers a new set of Web Components to compose and add basic maps applications to websites, removing the need to write extensive JavaScript.

The basic example shows how to add a map with a marker to a website:

```html <gmp-map style=”height: 500px;” center=”41.081736,29.009206” zoom=”10” map-id=”DEMO_MAP_ID”

<gmp-advanced-marker position=”41.081736,29.009206” title=”Istanbul” ```

More interactive maps can be built with auxiliary components for buttons, layout and overlays.

This is a positive development: Web Components allow developers to add basic map functionality to websites without resorting to additional frameworks with potentially heavy footprints. I’d like to see more proposals like this.

Open-source alternatives are available (for OpenLayers) or have not seen significant development in recent years (for Leaflet).