JSPM

googlemap

1.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7
  • Score
    100M100P100Q39408F
  • License WTFPL

A simple module for displaying Google Maps

Package Exports

  • googlemap

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (googlemap) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

googlemap

Simple class which makes Google Maps out of HTML attributes.

Documentation

Sample data and HTML markup (latitude and longitude are required for each item):

[
    {
        "latitude": 55.944083,
        "longitude": -3.161833,
        "title": "Arthurs Seat"
    },
    {
        "latitude": 51.507752,
        "longitude": -0.12793,
        "title": "Nelsons Column"
    }
]
<div id="map" data-markers='{{ markers }}'></div>

Simple example:

var mapCanvas = document.getElementById('map');

new GoogleMap(mapCanvas);

Marker click event callbacks:

var mapCanvas = document.getElementById('map');

new GoogleMap(mapCanvas, {
    markerClickCallback: function (marker, data) {
        return window.location = 'http://www.google.co.uk?q=' + data.title;
    }
});