Various debug fixes (#4515)
* various debug fixes * fix mixed spaces and tabs
This commit is contained in:
parent
19f048110f
commit
425fa13cb4
@ -83,6 +83,7 @@
|
||||
**********/
|
||||
// OSM Basemap
|
||||
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||
osmAttrib = '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors';
|
||||
|
||||
var osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: ''}).addTo(map1);
|
||||
|
||||
|
@ -197,7 +197,7 @@
|
||||
map.addLayer(grid);
|
||||
|
||||
var marker1 = L.marker(kyiv).addTo(map),
|
||||
marker2 = L.marker(lnd).addTo(map);
|
||||
marker2 = L.marker(lnd).addTo(map),
|
||||
marker3 = L.marker(dc).addTo(map),
|
||||
marker4 = L.marker(sf).addTo(map),
|
||||
marker5 = L.marker(trd).addTo(map),
|
||||
|
@ -65,7 +65,7 @@
|
||||
var path = new L.Polyline([kyiv, trd, lnd, mad, dc, sf]).addTo(map);
|
||||
|
||||
var marker1 = L.marker(kyiv).addTo(map),
|
||||
marker2 = L.marker(lnd).addTo(map);
|
||||
marker2 = L.marker(lnd).addTo(map),
|
||||
marker3 = L.marker(dc).addTo(map),
|
||||
marker4 = L.marker(sf).addTo(map),
|
||||
marker5 = L.marker(trd).addTo(map),
|
||||
|
@ -10,7 +10,6 @@
|
||||
<link rel="stylesheet" href="../css/screen.css" />
|
||||
<script type="text/javascript" src="../../build/deps.js"></script>
|
||||
<script src="../leaflet-include.js"></script>
|
||||
<script type='text/javascript' src='http://code.jquery.com/jquery-1.8.0.js'></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@ -26,7 +25,7 @@
|
||||
|
||||
map.addLayer(demoMap);
|
||||
|
||||
$('#foo').click(function() {
|
||||
document.getElementById('foo').addEventListener('click', function() {
|
||||
var topoUrl='http://server.arcgisonline.com/ArcGIS/rest/services/USA_Topo_Maps/MapServer/tile/{z}/{y}/{x}';
|
||||
var topoMap = new L.TileLayer(topoUrl, { maxZoom: 19, attribution: 'Tiles: © Esri' });
|
||||
map.addLayer(topoMap);
|
||||
|
@ -3,8 +3,9 @@
|
||||
<link rel="stylesheet" href="../../dist/leaflet.css" />
|
||||
<link rel="stylesheet" href="../css/screen.css" />
|
||||
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../../build/deps.js"></script>
|
||||
|
||||
<script src="../leaflet-include.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@ -12,8 +13,6 @@
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready(function() {
|
||||
//Init a map, and attempt a locate.
|
||||
var map = L.map('map', {
|
||||
center: [39.84, -96.591],
|
||||
@ -33,13 +32,8 @@
|
||||
});
|
||||
|
||||
//For experiments using setRadius
|
||||
window.marker = L.circleMarker(map.getCenter(),{radius:30}).addTo(vanillaLayer);
|
||||
});
|
||||
|
||||
var marker = L.circleMarker(map.getCenter(),{radius:30}).addTo(vanillaLayer);
|
||||
</script>
|
||||
<script type="text/javascript" src="../../build/deps.js"></script>
|
||||
|
||||
<script src="../leaflet-include.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -8,10 +8,14 @@
|
||||
<link rel="stylesheet" href="../../dist/leaflet.css" />
|
||||
|
||||
<link rel="stylesheet" href="../css/screen.css" />
|
||||
<script type='text/javascript' src='http://code.jquery.com/jquery-1.8.0.js'></script>
|
||||
|
||||
<script type="text/javascript" src="../../build/deps.js"></script>
|
||||
<script src="../leaflet-include.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="map"></div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||
osmAttrib = '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
||||
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
|
||||
@ -45,14 +49,6 @@
|
||||
});
|
||||
|
||||
polygons.addTo(map);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../build/deps.js"></script>
|
||||
<script src="../leaflet-include.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="map"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -13,7 +13,7 @@
|
||||
osm = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png');
|
||||
|
||||
|
||||
recreateMap = function(){
|
||||
var recreateMap = function(){
|
||||
// destroy previous map and div
|
||||
|
||||
if(map) map.remove(); // This will destroy all DOM childs from layers and controls
|
||||
|
@ -11,7 +11,6 @@
|
||||
<link rel="stylesheet" href="../css/screen.css" />
|
||||
<script type="text/javascript" src="../../build/deps.js"></script>
|
||||
<script src="../leaflet-include.js"></script>
|
||||
<script type='text/javascript' src='http://code.jquery.com/jquery-1.8.0.js'></script>
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
@ -47,12 +46,10 @@
|
||||
dragging : false,
|
||||
worldCopyJump : true
|
||||
});
|
||||
$("#foo").click(function() {
|
||||
document.getElementById("foo").addEventListener('click', function() {
|
||||
map2.dragging.enable();
|
||||
});
|
||||
|
||||
|
||||
|
||||
addLayerAndMarker(map1);
|
||||
addLayerAndMarker(map2);
|
||||
|
||||
|
@ -31,17 +31,19 @@
|
||||
var map = new L.Map('map', {center: latlng, zoom: 15, layers: [osm]});
|
||||
|
||||
//Create a marker, clicking it toggles opacity
|
||||
var marker = new L.Marker(latlng, { icon: new L.DivIcon({ className: 'mybox', iconSize: new L.Point(100,100), html: 'opaque. click to toggle' }) });
|
||||
var opaqueIcon = new L.DivIcon({ className: 'mybox', iconSize: new L.Point(100,100), html: 'opaque. click to toggle' });
|
||||
var transparentIcon = new L.DivIcon({ className: 'mybox', iconSize: new L.Point(100,100), html: 'transparent' });
|
||||
var marker = new L.Marker(latlng, { icon: opaqueIcon });
|
||||
map.addLayer(marker);
|
||||
|
||||
var visible = true;
|
||||
marker.on('click', function () {
|
||||
if (visible) {
|
||||
marker.setOpacity(0.3);
|
||||
marker._icon.innerHTML = 'transparent';
|
||||
marker.setIcon(transparentIcon)
|
||||
} else {
|
||||
marker.setOpacity(1);
|
||||
marker._icon.innerHTML = 'opaque';
|
||||
marker.setIcon(opaqueIcon);
|
||||
}
|
||||
visible = !visible;
|
||||
});
|
||||
|
@ -18,10 +18,9 @@
|
||||
<script>
|
||||
var map = L.map('map').setView([51.505, -0.09], 13);
|
||||
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(map);
|
||||
map.on('click', function(e) {
|
||||
map.on('click', function(e) {
|
||||
L.popup().setLatLng(e.latlng).setContent('Hello').openOn(map);
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -74,7 +74,7 @@
|
||||
// Map bounds
|
||||
L.rectangle(bounds,{
|
||||
fill: false,
|
||||
stroke: 3,
|
||||
weight: 3,
|
||||
color: 'black'
|
||||
}).addTo(map);
|
||||
|
||||
|
@ -137,9 +137,10 @@
|
||||
geojson = L.geoJson(statesData, {
|
||||
style: style,
|
||||
onEachFeature: onEachFeature
|
||||
}).addTo(map);
|
||||
});
|
||||
|
||||
map.attributionControl.addAttribution('Population data © <a href="http://census.gov/">US Census Bureau</a>');
|
||||
geojson.getAttribution = function() { return 'Population data © <a href="http://census.gov/">US Census Bureau</a>' };
|
||||
geojson.addTo(map);
|
||||
|
||||
|
||||
var legend = L.control({position: 'bottomright'});
|
||||
|
@ -55,9 +55,9 @@
|
||||
path.bindPopup('I am a polyline');
|
||||
|
||||
var p1 = latlngs[0],
|
||||
p2 = latlngs[parseInt(len/4)],
|
||||
p3 = latlngs[parseInt(len/3)],
|
||||
p4 = latlngs[parseInt(len/2)],
|
||||
p2 = latlngs[Math.round(len / 4)],
|
||||
p3 = latlngs[Math.round(len / 3)],
|
||||
p4 = latlngs[Math.round(len / 2)],
|
||||
p5 = latlngs[len - 1],
|
||||
polygonPoints = [p1, p2, p3, p4, p5];
|
||||
|
||||
|
@ -18,7 +18,9 @@
|
||||
osmAttrib = '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
||||
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
|
||||
|
||||
var map = new L.Map('map', {layers: [osm]});
|
||||
var svg = L.svg();
|
||||
|
||||
var map = new L.Map('map', {layers: [osm], renderer: svg});
|
||||
|
||||
map.addLayer(L.marker(route[0]));
|
||||
map.addLayer(L.marker(route[route.length - 1]));
|
||||
@ -51,7 +53,7 @@
|
||||
'circle': circle,
|
||||
'circleMarker': circleMarker,
|
||||
'canvas': canvas,
|
||||
'svg': map._renderer,
|
||||
'svg': svg,
|
||||
}, {collapsed: false});
|
||||
map.addControl(layersControl);
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user