Fix debug examples after rollup (#5417)

Fix #5373.

- Remove references to removed file "../../build/deps.js"
- Update leaflet-include.js to point to "../dist/leaflet-src.js"
- Update watch to use the same destination file as rollup (dist/leaflet-src.js)
- Define getRandomLatLng where used
This commit is contained in:
Thach Hoang 2017-03-28 02:40:48 -04:00 committed by Per Liedman
parent 06ed42ad2c
commit 0d1eae32be
70 changed files with 82 additions and 91 deletions

View File

@ -34,7 +34,7 @@ export default {
moduleName: 'L',
banner: warningCode,
entry: 'src/Leaflet.js',
dest: 'debug/leaflet-rollup-src.js',
dest: 'dist/leaflet-src.js',
plugins: [
rollupGitVersion()
],

View File

@ -8,7 +8,6 @@
<meta name="viewport" content="width=device-width,initial-scale=1 maximum-scale=1.0 user-scalable=0">
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -1 +1 @@
leaflet-rollup-src.js
../dist/leaflet-src.js

View File

@ -7,7 +7,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -7,7 +7,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -7,7 +7,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -8,7 +8,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -9,7 +9,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -9,7 +9,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -9,7 +9,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -9,7 +9,6 @@
<link rel="stylesheet" href="../css/mobile.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -9,7 +9,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -9,7 +9,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>
@ -29,9 +28,21 @@
var markers = new L.FeatureGroup();
function getRandomLatLng(llbounds) {
var s = llbounds.getSouth(),
n = llbounds.getNorth(),
w = llbounds.getWest(),
e = llbounds.getEast();
return L.latLng(
s + (Math.random() * (n - s)),
w + (Math.random() * (e - w))
)
}
function populate() {
for (var i = 0; i < 10; i++) {
L.marker(getRandomLatLng(map)).addTo(markers);
L.marker(getRandomLatLng(map.getBounds())).addTo(markers);
}
return false;
}

View File

@ -9,7 +9,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -9,7 +9,6 @@
<link rel="stylesheet" href="../css/mobile.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -9,7 +9,6 @@
<link rel="stylesheet" href="../css/mobile.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -9,7 +9,6 @@
<link rel="stylesheet" href="../css/mobile.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -9,7 +9,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
<style>
.mapcontainer {

View File

@ -9,7 +9,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>
@ -26,18 +25,30 @@
.setView([50.5, 30.51], 15)
.addLayer(osm);
function getRandomLatLng(llbounds) {
var s = llbounds.getSouth(),
n = llbounds.getNorth(),
w = llbounds.getWest(),
e = llbounds.getEast();
return L.latLng(
s + (Math.random() * (n - s)),
w + (Math.random() * (e - w))
)
}
var features = new L.FeatureGroup([
L.marker(getRandomLatLng(map)),
L.marker(getRandomLatLng(map.getBounds())),
L.polyline([
getRandomLatLng(map),
getRandomLatLng(map),
getRandomLatLng(map)
getRandomLatLng(map.getBounds()),
getRandomLatLng(map.getBounds()),
getRandomLatLng(map.getBounds())
]),
L.polygon([
getRandomLatLng(map),
getRandomLatLng(map),
getRandomLatLng(map),
getRandomLatLng(map)
getRandomLatLng(map.getBounds()),
getRandomLatLng(map.getBounds()),
getRandomLatLng(map.getBounds()),
getRandomLatLng(map.getBounds())
])
]);
@ -49,23 +60,23 @@
content.innerText = 'I\'m a red polygon';
var polygon = L.polygon([
getRandomLatLng(map),
getRandomLatLng(map),
getRandomLatLng(map),
getRandomLatLng(map)
getRandomLatLng(map.getBounds()),
getRandomLatLng(map.getBounds()),
getRandomLatLng(map.getBounds()),
getRandomLatLng(map.getBounds())
], {
color: 'red'
}).bindPopup(content).addTo(map);
var polyline = L.polyline([
getRandomLatLng(map),
getRandomLatLng(map),
getRandomLatLng(map)
getRandomLatLng(map.getBounds()),
getRandomLatLng(map.getBounds()),
getRandomLatLng(map.getBounds())
], {
color: 'red'
}).bindPopup('I\'m a red polyline').addTo(map);
var marker = L.circleMarker(getRandomLatLng(map), {
var marker = L.circleMarker(getRandomLatLng(map.getBounds()), {
color: 'red',
radius: 25
}).bindPopup('I\'m a red circle').addTo(map);

View File

@ -9,8 +9,7 @@
<link rel="stylesheet" href="../css/screen.css" />
<!-- <script src="../../dist/leaflet-rollup-src.js"></script> -->
<script src="../leaflet-rollup-src.js"></script>
<script src="../../dist/leaflet-src.js"></script>
</head>
<body>

View File

@ -7,7 +7,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -9,7 +9,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -65,7 +65,6 @@
}
</style>
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -7,7 +7,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -7,7 +7,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
<style type="text/css">
.my-div-icon {

View File

@ -7,7 +7,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -7,7 +7,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -9,7 +9,6 @@
<link rel="stylesheet" href="../css/mobile.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
<style>
.container {

View File

@ -7,7 +7,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -7,7 +7,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>
@ -31,8 +30,20 @@
L.control.scale().addTo(map);
function getRandomLatLng(llbounds) {
var s = llbounds.getSouth(),
n = llbounds.getNorth(),
w = llbounds.getWest(),
e = llbounds.getEast();
return L.latLng(
s + (Math.random() * (n - s)),
w + (Math.random() * (e - w))
)
}
for (var i = 0; i < 1000; i++) {
L.marker(getRandomLatLng(map)).addTo(map);
L.marker(getRandomLatLng(map.getBounds())).addTo(map);
}

View File

@ -19,7 +19,6 @@
}
</style>
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -9,7 +9,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -8,7 +8,6 @@
<link rel="stylesheet" href="../../dist/leaflet.css" />
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -3,7 +3,6 @@
<link rel="stylesheet" href="../../dist/leaflet.css" />
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>

View File

@ -9,7 +9,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -9,7 +9,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
<style>

View File

@ -5,7 +5,6 @@
<link rel="stylesheet" href="../../dist/leaflet.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
<script>
var map,

View File

@ -9,7 +9,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>
@ -35,12 +34,23 @@
return function(ev) { document.getElementById('perf').innerHTML = ('Event on marker ' + i + ': ' + ev.type); }
}
function getRandomLatLng(llbounds) {
var s = llbounds.getSouth(),
n = llbounds.getNorth(),
w = llbounds.getWest(),
e = llbounds.getEast();
return L.latLng(
s + (Math.random() * (n - s)),
w + (Math.random() * (e - w))
)
}
function populate() {
var start = performance ? performance.now() : 0;
for (var i = 0; i < 100; i++) {
L.marker(getRandomLatLng(map)).addTo(markers).on('dblclick', getEventHandler(i));
L.marker(getRandomLatLng(map.getBounds())).addTo(markers).on('dblclick', getEventHandler(i));
}
var end = performance ? performance.now() : 0;

View File

@ -9,7 +9,6 @@
<link rel="stylesheet" href="../../dist/leaflet.css" />
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -9,7 +9,6 @@
<link rel="stylesheet" href="../../dist/leaflet.css" />
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -9,7 +9,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>
@ -41,6 +40,18 @@
clicks++;
});
function getRandomLatLng(llbounds) {
var s = llbounds.getSouth(),
n = llbounds.getNorth(),
w = llbounds.getWest(),
e = llbounds.getEast();
return L.latLng(
s + (Math.random() * (n - s)),
w + (Math.random() * (e - w))
)
}
function shuffleMarkers() {
var marker;
if (markerArr.length > 2000) {
@ -48,7 +59,7 @@
marker = markerArr.splice(i, 1)[0];
markers.removeLayer(marker);
} else {
marker = L.marker(getRandomLatLng(map))
marker = L.marker(getRandomLatLng(map.getBounds()))
.on('mouseover', function() {
marker.setZIndexOffset(10000);
})

View File

@ -4,7 +4,6 @@
<meta name="viewport" id="vp" content="initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-width" />
<link rel="stylesheet" href="../../dist/leaflet.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
<meta charset="utf-8">

View File

@ -33,7 +33,6 @@
}
}
</style>
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
<table>
<tr><td> </td><td>Enter </td><td>Move </td><td>Exit </td><td>Click </td></tr>

View File

@ -14,7 +14,6 @@
}
</style>
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -9,7 +9,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -9,7 +9,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -7,7 +7,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -8,7 +8,6 @@
<link rel="stylesheet" href="../../dist/leaflet.css" />
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
<script src="http://code.jquery.com/jquery-1.8.0.js"></script>
</head>

View File

@ -6,7 +6,6 @@
<link rel="stylesheet" href="../../dist/leaflet.css" />
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -9,7 +9,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
<style>
body {

View File

@ -7,7 +7,6 @@
<link rel="stylesheet" href="../css/mobile.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
<style>
#map { height: 100%; }

View File

@ -5,7 +5,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -8,7 +8,6 @@
<link rel="stylesheet" href="../../dist/leaflet.css" />
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
<script src="http://code.jquery.com/jquery-1.8.0.js"></script>
</head>

View File

@ -9,7 +9,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
<style>
#map {

View File

@ -9,7 +9,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
<style>
#map {

View File

@ -9,7 +9,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
<style>
</style>

View File

@ -11,7 +11,6 @@
<link rel="stylesheet" href="../../dist/leaflet.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
<script src="../../node_modules/prosthetic-hand/dist/prosthetic-hand.js"></script>

View File

@ -11,7 +11,6 @@
<link rel="stylesheet" href="../../dist/leaflet.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
<script src="../../node_modules/prosthetic-hand/dist/prosthetic-hand.js"></script>

View File

@ -7,7 +7,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -7,7 +7,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -40,7 +40,6 @@
}
</style>
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -9,7 +9,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -7,7 +7,6 @@
<link rel="stylesheet" href="../../dist/leaflet.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -7,7 +7,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -7,7 +7,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -7,7 +7,6 @@
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -9,7 +9,6 @@
<link rel="stylesheet" href="../css/mobile.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -9,7 +9,6 @@
<link rel="stylesheet" href="../css/mobile.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -6,7 +6,6 @@
<link rel="stylesheet" href="../../dist/leaflet.css" />
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>

View File

@ -6,7 +6,6 @@
<link rel="stylesheet" href="../../dist/leaflet.css" />
<link rel="stylesheet" href="../css/screen.css" />
<script src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>