A friendly Ember addon for working with Google Maps.
- Create and draw on your maps using Ember components.
- Automatically load the Google Maps API on demand and safely access it across your whole app.
ember-google-maps has been around for years. It started as Sander Melnikov's work and is now maintained by Acorn Web Consultants, rebuilt as a modern v2 addon for Ember Octane and Polaris.
If you use it in your commercial work, or just find it useful, consider sponsoring ongoing maintenance and API costs.
Thank you! 🙌
- Documentation
- Upgrading to v8
- Compatibility
- Examples
- Companion packages
- Maintainers
- Contributing
- License
- Disclaimer
New to Ember? Learn how to use Ember and install addons →
Looking for a more general mapping solution? Check out ember-leaflet →.
Get started with ember-google-maps →
- Install the addon.
ember install ember-google-maps- Provide a Google Maps API key in
config/environment.js. Learn how to create an API key →
'ember-google-maps': {
key: '<GOOGLE_MAPS_API_KEY>',
}- Give your map a size, or you'll end up staring at a blank screen.
ember-google-mapis the default class for all maps.
.ember-google-map {
width: 500px;
height: 500px;
}- Draw a map at some coordinates.
- That's it — you've drawn a map.
Now keep reading the docs →
v8 is a big change: the addon is now a v2 (Embroider/Vite) addon, and the old <GMap as |g|> yielded API is deprecated in favour of rendering components as direct children (shown below).
Read the Upgrading to v8 guide →
- Ember.js v5.12 or above
- Node.js v18 or above
- A v2-addon-capable build: Embroider or Vite
Display a map centered on a set of coordinates.
Display a set of locations using markers 📍. Render the components as direct children of the map. Advanced markers need a Map ID on the map — swap the placeholder for a real one.
Display a custom overlay — like an HTML marker — using template blocks 😱. This lets you do all sorts of fancy things, like CSS animations and bound data.
Writing .gjs / .gts components? Import the components and render them directly — no name resolution needed.
import { GMap, AdvancedMarker } from 'ember-google-maps';
<template>
<GMap @lat="51.508530" @lng="-0.076132" @zoom={{10}} @mapId="DEMO_MAP_ID">
<AdvancedMarker @lat="51.508530" @lng="-0.076132" />
</GMap>
</template>- Directions — draw routes and directions on your maps. Being brought over from v7 as a separate package.
- Clustering — group nearby markers together. Coming soon.
- Maintained by Acorn Web Consultants (David Baker).
- Originally created by Sander Melnikov.
See the Contributing guide for details.
MIT © Sander Melnikov and contributors.
This software is not endorsed, maintained, or supported by Google LLC.
© 2020 Google LLC All rights reserved. Google Maps™ is a trademark of Google LLC.