Skip to content

Instantly share code, notes, and snippets.

@AbdulKabia
Created March 28, 2018 01:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AbdulKabia/6d96c7145fc510a5ff9b615f0db06f50 to your computer and use it in GitHub Desktop.
Save AbdulKabia/6d96c7145fc510a5ff9b615f0db06f50 to your computer and use it in GitHub Desktop.
'use strict';
// Using Material Icons as inline SVG - https://material.io/icons/
const leaflet = require('leaflet');
// Read contents of SVG files from bundle as Data URLs
const locationSvgUrl = require('../icons/material-icons/location.svg');
const lockedSvgUrl = require('../icons/material-icons/locked.svg');
const unlockedSvgUrl = require('../icons/material-icons/unlocked.svg');
// Read white icons for when it's dark out
const locationSvgWhite = require('../icons/material-icons/location-white.svg');
const lockedSvgWhite = require('../icons/material-icons/locked-white.svg');
const unlockedSvgWhite = require('../icons/material-icons/unlocked-white.svg');
// All icons share the same size, define it once
const iconSize = [25, 25];
// Expose custom Leaflet Icons to be used in our markers
module.exports.location = leaflet.icon({
iconUrl: locationSvgUrl,
iconSize
});
// Expose custom Leaflet Icons to be used in our markers
module.exports.locationWhite = leaflet.icon({
iconUrl: locationSvgWhite,
iconSize
});
module.exports.locked = leaflet.icon({
iconUrl: lockedSvgUrl,
iconSize
});
module.exports.lockedWhite = leaflet.icon({
iconUrl: lockedSvgWhite,
iconSize
});
module.exports.unlocked = leaflet.icon({
iconUrl: unlockedSvgUrl,
iconSize
});
module.exports.unlockedWhite = leaflet.icon({
iconUrl: unlockedSvgWhite,
iconSize
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment