Skip to content

Instantly share code, notes, and snippets.

@line: #226688;
@shade0: #FFFFFF;
@shade1: #FFFFE5;
@shade2: #FFF7BC;
@shade3: #FEE391;
@shade4: #FEC44F;
@shade5: #FE9929;
@shade6: #EC7014;
@shade7: #CC4C02;
@shade8: #993404;
var regionLayer = L.geoJson(regions, {
style: {
color: '#550055',
weight: 1,
opacity: 1,
fillOpacity: 0
},
onEachFeature: function(feature, layer) {
layer.bindPopup('<strong>' + feature.properties.REGC_NAME + '</strong>');
layer.on({
var tour = L.layerGroup([
L.cartoDB('http://thematicmapping.cartodb.com/api/v2/sql?q=SELECT * FROM nz_tour', {
pointToLayer: function(feature, latlng) {
return L.marker(latlng, {
icon: L.icon({
iconSize: [27, 27],
iconAnchor: [13, 27],
popupAnchor: [1, -24],
iconUrl: 'icons/' + feature.properties.icon + '.png'
})
@turban
turban / dochuts.js
Last active October 11, 2015 21:28
var huts = new L.MarkerClusterGroup({
showCoverageOnHover: false,
maxClusterRadius: 50
});
var hutTypes = ['Basic Hut/Bivvy', 'Standard Hut', 'Serviced Hut', 'Serviced-Alpine Hut', 'Great Walk Hut'];
huts.addLayers(data.map(function(hut) {
return new L.Marker(new L.LatLng(hut[0], hut[1]), {
title: hut[2],
L.geoJson(springs, {
pointToLayer: function (feature, latlng) {
return L.circleMarker(latlng, {
fillColor: (feature.properties.temp === 'hot') ? '#f00' : '#00f',
radius: 4,
color: "#333",
weight: 1,
fillOpacity: 1
});
},
// Create map layers
var layers = {
'Seafloor': L.tileLayer('tiles/nz-seafloor/{z}/{x}/{y}.png', {
maxZoom: 9,
attribution: '<a href="http://www.niwa.co.nz/our-science/oceans/bathymetry">NIWA</a>'
}),
'Topographic': L.tileLayer('tiles/nz-topo/{z}/{x}/{y}.png', {
attribution: '<a href="http://data.linz.govt.nz/">LINZ</a>, <a href="http://lris.scinfo.org.nz/">LRIS</a>'
}),
L.cartoDB('http://thematicmapping.cartodb.com/api/v2/sql?q=SELECT * FROM nz_tour', {
pointToLayer: function(feature, latlng) {
return L.marker(latlng, {
icon: L.icon({
iconSize: [27, 27],
iconAnchor: [13, 27],
popupAnchor: [1, -24],
iconUrl: 'icons/' + feature.properties.icon + '.png'
})
})
L.CartoDB = L.GeoJSON.extend({
initialize: function (url, options) {
L.Util.setOptions(this, options);
this._layers = {};
var self = this;
if (url) {
this._jsonp(url, function(geojson){
var seafloor = L.tileLayer('tiles/nz-seafloor/{z}/{x}/{y}.png', {
maxZoom: 9,
attribution: 'Map data from <a href="http://www.niwa.co.nz/our-science/oceans/bathymetry">NIWA</a>'
});
var topo = L.tileLayer('tiles/nz-topo/{z}/{x}/{y}.png', {
attribution: '<a href="http://data.linz.govt.nz/">LINZ</a>, <a href="http://lris.scinfo.org.nz/">LRIS</a>'
});
var map = new L.Map('map', {
@water: #96cfe6;
@ice: #fff;
@shingle: #ccc;
@sand: #f1dfaa;
@swamp: #749039;
@mangrove: #79b779;
@exotic: #53a550;
@native: #39af34;
@mud: #bfb69b;
@residental: #fed700;