npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ember-cli-google-maps

v0.9.7

Published

The default blueprint for ember-cli addons.

Downloads

40

Readme

ember-cli-google-maps

A simple Ember add-on from Google Maps API

Features

  • Simplistic design for integrating Google Maps
  • Intelligent configuration based on component utilized
  • No extra steps to configure Google Maps beyond adding API key
  • Extensible component-based design to maximize customization

Compatibility

  • Ember.js v4.8 or above
  • Ember CLI v4.8 or above
  • Node.js v18 or above

Installation

ember install ember-cli-google-maps

Getting Started

Configuring API Key

Before you can use this add-on, you must first configure our API key. Add your Google Maps API key to config/environment.js.

 let ENV = {
    // ...

    'ember-cli-google': {
      maps: {
        apiKey: 'ADD API KEY HERE'
      }
    }
  };

Inserting a map

Use the <GMap /> component to insert a map onto the page.

<GMap @center={{hash lat=lat lng=lng}} />

The <GMap /> component must have a @center property, or the Google Maps component will not work. The <GMap /> component has a corresponding attribute for each google.maps.MapOptions property.

The <GMap /> component has the .g-map class name, which can be used to style it (e.g., setting its height and width).

Map Entities

Map entities are added as a child component of the corresponding <GMap /> block component. All map entities have a @show attribute, which can be use to show/hide the entity.

Adding a marker

Add the <GMarker /> as a child of the <GMap /> block component to add a marker to a map. The @position attribute to set the marker's location.

<GMap @center={{hash lat=mapLat lng=mapLng}}>
  <GMarker @position={{hash lat=lat lng=lng}} />
</GMap>

Map Layers

Map layers are added as a child component of the corresponding <GMap /> block component. All map layers have a @show attribute, which can be used to show/hide the layer.

Heatmap Layer

The <GHeatmapLayer /> is used to add a heatmap layer to the corresponding map. The @data attribute, which is an array of {lat, lng [, weight]}, adds data to the heatmap.

<GMap @center={{hash lat=mapLat lng=mapLng}}>
    <GHeatmapLayer @data=heatmapData />
</GMap>

Unlike with the Google Maps API, you can have a single array where some of the data points have a weight and some of the data points do not have a weight. The <GHeatmapLayer /> component is intelligent enough to discern between the two cases, and populate the map accordingly.