On Github MappingKat / startup-denver-prezzy
Not yet.
Source:http://openstreetmap.us/2013/04/openstreetmap-in-government
Use tags as key = value to define map features
<!DOCTYPE html> <html> <head> <title> Leaflet Demo </title> </head> <body> </body> </html>
<head> <title> Leaflet Demo </title> <link rel= "stylesheet" href="//cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" /> </head>
<body> <script src="//cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script> </body>
<body> <div id="map"></div> <script src="//cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script> </body>
<head> <title> Leaflet Demo </title> <style> body, html { height: 100%; } #map { width: 100%; height: 100%; } </style> </head>
<body> <div id="map"></div> <script src="//cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script> <script> </script> </body>
var map = L.map('map').setView([39.75, -105], 15);
L.tileLayer('https://{s}.tiles.mapbox.com/v3/{id}/{z}/{x}/{y}.png', { maxZoom: 18, attribution: "OpenStreetMap, Mapbox, and NPS", id: 'nps.k7chg4fe' }).addTo(map);
var marker = L.marker([39.75, -105]).addTo(map);
<body> <div id="map"></div> <style src="//cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script> <style src="//cdnjs.cloudflare.com/ajax/libs/reqwest/1.1.5/reqwest.min.js" ></script> <script> ... </script> </body>
var geojsonLink = 'https://npmap-demo-account.cartodb.com/api/v1/sql?q=select+*+from+restaurants_modified&format=geojson';
reqwest(geojsonLink, function(result) { L.geoJson(result).addTo(map); });
reqwest(geojsonLink, function(result) { L.geoJson(result, { pointToLayer: function(feature, latlng) { return L.circleMarker(latlng); } }).addTo(map); });
reqwest(geojsonLink, function(result) { L.geoJson(result, { pointToLayer: function(feature, latlng) { return L.circleMarker(latlng, { color: 'white', fillOpacity: 1, radius: 6 }); } }).addTo(map); });
var colors = { 'Bar': '#8e44ad', 'Cafe': '#e74c3c', 'Pub ': '#16a085', 'Restaurant': '#f1c40f' };
reqwest(geojsonLink, function(result) { L.geoJson(result, { pointToLayer: function(feature, latlng) { return L.circleMarker(latlng, { color: 'white', fillColor: colors[feature.properties.amenity], fillOpacity: 1, radius: 6 }); } }).addTo(map); });
<body> <div id="map"></div> <script src="//cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/reqwest/1.1.5/reqwest.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/handlebars.js/2.0.0/handlebars.min.js"></script> <script> ... </script> </body>
var popupContent = function ( properties ) { var content = '<div class="popup">' + '<span class="title">{{name}}</span><br/>' + '{{address}}<br/>' + '<hr/>' + '<span class="title">Amenity</span>: {{amenity}}<br/>' + '<span class="title">Cuisine</span>: {{cuisine}}<br/>' + '<span class="title">Rating</span>: {{rating}}' + '</div>'; return Handlebars .compile(content)(properties); };
reqwest(geojsonLink, function(result) { L. geoJson(result, { pointToLayer: function(feature, latlng) { return L.circleMarker(latlng, { color: 'white' , fillColor: colors[feature .properties . amenity], fillOpacity: 1, radius: 6 });}, onEachFeature: function (feature, layer) { return layer .bindPopup( popupContent(feature . properties)); } }).addTo(map); });
<head> <title> Leaflet Demo </title> <link rel= "stylesheet" href= "//cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" /> <link rel="stylesheet" href= "//leaflet.github.io/Leaflet.draw/leaflet.draw.js" /> </head>
<body> <div id="map"></div> <script src="//cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/reqwest/1.1.5/reqwest.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/handlebars.js/2.0.0/handlebars.min.js"></script> <script src="//leaflet.github.io/Leaflet.draw/leaflet.draw.js"></script> <script> ... </script> </body>
var drawnItems = new L.FeatureGroup(); map.addLayer(drawnItems); var drawControl = new L.Control.Draw({ draw: { position: 'topleft' , polygon: { title:#{i+1}) #{element.label}.field-clearspan> 'Draw a sexy polygon!', allowIntersection: false, drawError: { color: '#b00b00', timeout: 1000 }, shapeOptions: { color: '#bada55' }, showArea: true }, polyline: { metric: false }, circle: { shapeOptions: { color: '#662d91' } } }, edit: { featureGroup: drawnItems } }); map.addControl(drawControl); map.on('draw:created', function (e) { var type = e.layerType, layer = e.layer; if (type === 'marker' ) { layer.bindPopup('A popup!'); } drawnItems.addLayer(layer); });