//= require_self
+//= require leaflet.customzoom
+//= require leaflet.locate
//= require leaflet.layers
-//= require leaflet.share
+//= require leaflet.key
//= require leaflet.note
-//= require leaflet.locate
-//= require leaflet.customzoom
+//= require leaflet.share
//= require index/browse
//= require index/export
//= require index/key
L.control.customZoom({position: 'topright'})
.addTo(map);
+ L.control.locate({position: 'topright'})
+ .addTo(map);
+
var uiPane = $('#map-ui')[0];
L.OSM.layers({
uiPane: uiPane
}).addTo(map);
+ L.OSM.key({
+ position: 'topright',
+ uiPane: uiPane
+ }).addTo(map);
+
+ L.control.note({
+ position: 'topright',
+ uiPane: uiPane
+ }).addTo(map);
+
L.control.share({
getUrl: getShortUrl,
uiPane: uiPane
}).addTo(map);
- L.control.note({ position: 'topright' }).addTo(map);
- L.control.locate({ position: 'topright' }).addTo(map);
- L.control.scale().addTo(map);
+ L.control.scale()
+ .addTo(map);
map.on('moveend layeradd layerremove', updateLocation);
--- /dev/null
+L.OSM.Key = L.Control.extend({
+ onAdd: function (map) {
+ this._map = map;
+ this._initLayout();
+ return this.$container[0];
+ },
+
+ _initLayout: function () {
+ var map = this._map;
+
+ this.$container = $('<div>')
+ .attr('class', 'control-key');
+
+ var link = $('<a>')
+ .attr('class', 'control-button')
+ .attr('href', '#')
+ .attr('title', 'Map Key')
+ .html('<span class="icon key"></span>')
+ .appendTo(this.$container);
+ }
+});
+
+L.OSM.key = function(options) {
+ return new L.OSM.Key(options);
+};
margin-bottom: 10px;
}
-.leaflet-control a.zoomin {
+.leaflet-control a.zoomin,
+.control-layers a,
+.control-note a {
margin-bottom: 0px;
border-radius: 4px 4px 0px 0px;
}
.leaflet-control a.zoomout {
+ margin-bottom: 0px;
+ border-radius: 0px;
+}
+
+.control-locate a,
+.control-key a,
+.control-share a {
border-radius: 0px 0px 4px 4px;
}