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

google-maps-addon

v0.1.1

Published

Google maps Ember addon easy to consume

Downloads

10

Readme

google-maps-addon

Build Status Dependency Status NPM Version Ember Observer Score

DEMO

An Ember Addon

Google maps ember addon easy to consume.

Installation

  • ember install:addon google-maps-addon

Running Tests

  • ember test
  • ember test --server

Usage

{{google-maps-addon
  mapOptions=mapOptions
  markers=markers
  circles=circles
  rectangles=rectangles
  infoWindows=infoWindows}}

Map Options

The JSON mapOptions object is used to configure the base settings for the map.

All configuration options in some way relate to the official attributes for Google Maps Options objects.

mapOptions: {
  latitude: 'Your latitude',
  longitude: 'Your longitude',
  zoom: 'Your prefered zooming level',
  // Mouse events
  click(event) {
    // I promise a callback is assured for the particular event so have your code here
    // See the "Supported Mouse Events"-section for all events you can add
  }
}

Markers

The markers array contains an array of objects with configuration options that map to the MarkerOptions. All map one-to-one to their real options, except the position. You pass in a latitude and a longitude-property instead of a google.maps.LatLng as position.

The key attribute is custom to google-maps-addon and is used to intelligently diff objects when the markers array changes. All changes applied are all differential. You can update them as much as you can and expect reasonable performance.

markers: [
  {
    key: 'A unique value that identifies this marker as an entity',
    latitude: 'Your marker latitude if empty will takes up the center latitude',
    longitude: 'Your marker longitude if empty will takes up the center longitude',
    title: 'Your title, if not provided it takes up as empty string',
    animation: 'DROP' || 'BOUNCE',
    timeout: timeout after the window loads,
    icon: 'Specify the path of the icon',
    draggable: true,
    // Mouse events
    click(event) {
      // I promise a callback is assured for the particular event so have your code here
      // See the "Supported Mouse Events"-section for all events you can add
    }
  },
  {
    key: 'A unique value that identifies this marker as an entity',
    latitude: 'Your marker latitude if empty will takes up the center latitude',
    longitude: 'Your marker longitude if empty will takes up the center longitude',
    title: 'Your title, if not provided it takes up as empty string',
    animation: 'DROP' || 'BOUNCE',
    timeout: timeout after the window loads,
    icon: 'Specify the path of the icon',
    draggable: true,
    // Mouse events
    click(event) {
      // I promise a callback is assured for the particular event so have your code here
      // See the "Supported Mouse Events"-section for all events you can add
    }
  }
]

Circles

The circles array contains an array of objects with configuration options that map to the CircleOptions. All map one-to-one to their real options, except the position. You pass in a latitude and a longitude-property instead of a google.maps.LatLng as position.

The key attribute is custom to google-maps-addon and is used to intelligently diff objects when the circles array changes. All changes applied are all differential. You can update them as much as you can and expect reasonable performance.

circles: [{
  key: 'A unique value that identifies this marker as an entity',
  radius: 100, // Radius of the circle,
  latitude: number, // latitude of the center,
  longitude: number, // longitude of the center,
  fillColor: color, // fill color
  strokeColor: color, // stroke color
  // Mouse events
  click(event) {
    // I promise a callback is assured for the particular event so have your code here
    // See the "Supported Mouse Events"-section for all events you can add
  }
  // More options at https://developers.google.com/maps/documentation/javascript/reference#CircleOptions
}]

Rectangles

The rectangles array contains an array of objects with configuration options that map to the RectangleOptions. All map one-to-one to their real options. (Even the bounds-object)

The key attribute is custom to google-maps-addon and is used to intelligently diff objects when the rectangles array changes. All changes applied are all differential. You can update them as much as you can and expect reasonable performance.

rectangles: [{
  bounds: {
    northEast: number,
    southWest: number
  },
  fillColor: color,
  fillOpacity: float,
  click(event) {
    // I promise a callback is assured for the particular event so have your code here
    // See the "Supported Mouse Events"-section for all events you can add
  }
  // More options at https://developers.google.com/maps/documentation/javascript/reference#RectangleOptions
}]

Info Windows

The infoWindows array contains an array of objects with configuration options that map to the InfoWindowOptions. All map one-to-one to their real options, except the position. You pass in a latitude and a longitude-property instead of a google.maps.LatLng as position.

The key attribute is custom to google-maps-addon and is used to intelligently diff objects when the infoWindow array changes. All changes applied are all differential. You can update them as much as you can and expect reasonable performance.

infoWindows: [{
  key: 'my-window',
  content: 'Your HTML content here',
  latitude: 'Your info window latitude if empty will takes up the center latitude',
  longitude: 'Your info window longitude if empty will takes up the center longitude',
  maxWidth: 'The maximum width of the info window' //in number
  pixelOffset: 'The offset, in pixels, of the tip of the info window from the point on the map at whose geographical coordinates the info window is anchored. If an InfoWindow is opened with an anchor, the pixelOffset will be calculated from the anchors anchorPoint property.'
  // More options at https://developers.google.com/maps/documentation/javascript/reference#InfoWindowOptions
}]

Supported Mouse events

'click',
'dblclick',
'drag',
'dragend',
'dragstart',
'mousemove',
'mouseout',
'mouseover',
'rightclick'

Demo

Here is a small demo.

Issue and Feature request

Feel free to raise an issue or feature request.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Next Planned update,

More info window support (events, adding it to markers)

Need more interactions back into the component than getting out of component

License

google-maps-addon is MIT Licensed.