Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

update build with regression fixes

  • Loading branch information...
commit b1db46a3071787c33b4f20d58eb05d7998cde499 1 parent b2adb29
Vladimir Agafonkin mourner authored
34 debug/vector/vector-canvas.html
@@ -5,9 +5,9 @@
5 5
6 6 <link rel="stylesheet" href="../../dist/leaflet.css" />
7 7 <!--[if lte IE 8]><link rel="stylesheet" href="../../dist/leaflet.ie.css" /><![endif]-->
8   -
  8 +
9 9 <link rel="stylesheet" href="../css/screen.css" />
10   -
  10 +
11 11 <script>
12 12 L_PREFER_CANVAS = true; // experimental
13 13 </script>
@@ -24,36 +24,36 @@
24 24 <script>
25 25 var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/997/256/{z}/{x}/{y}.png',
26 26 cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18});
27   -
  27 +
28 28 for (var i = 0, latlngs = [], len = route.length; i < len; i++) {
29 29 latlngs.push(new L.LatLng(route[i][0], route[i][1]));
30 30 }
31 31 var path = new L.Polyline(latlngs);
32 32
33 33 var map = new L.Map('map', {layers: [cloudmade]});
34   -
  34 +
35 35 var group = new L.LayerGroup();
36 36
37 37 map.fitBounds(new L.LatLngBounds(latlngs));
38   -
  38 +
39 39 var circleLocation = new L.LatLng(51.508, -0.11),
40 40 circleOptions = {
41   - color: 'red',
42   - fillColor: 'yellow',
  41 + color: 'red',
  42 + fillColor: 'yellow',
43 43 fillOpacity: 0.7
44 44 };
45   -
  45 +
46 46 var circle = new L.Circle(circleLocation, 500000, circleOptions),
47 47 circleMarker = new L.CircleMarker(circleLocation, {fillColor: 'blue', fillOpacity: 1, stroke: false});
48   -
  48 +
49 49 group.addLayer(circle).addLayer(circleMarker);
50   -
  50 +
51 51 circle.bindPopup('I am a circle');
52 52 circleMarker.bindPopup('I am a circle marker');
53   -
54   - group.addLayer(path);
  53 +
  54 + group.addLayer(path);
55 55 path.bindPopup('I am a polyline');
56   -
  56 +
57 57 var p1 = latlngs[0],
58 58 p2 = latlngs[parseInt(len/4)],
59 59 p3 = latlngs[parseInt(len/3)],
@@ -66,14 +66,14 @@
66 66 h3 = new L.LatLng(p3.lat, p3.lng),
67 67 h4 = new L.LatLng(p4.lat, p4.lng),
68 68 h5 = new L.LatLng(p5.lat, p5.lng);
69   -
  69 +
70 70 h1.lng += 20;
71 71 h2.lat -= 5;
72 72 h3.lat -= 5;
73 73 h4.lng -= 10;
74 74 h5.lng -= 8;
75 75 h5.lat += 10;
76   -
  76 +
77 77 var holePoints = [h5, h4, h3, h2, h1];
78 78
79 79 var polygon = new L.Polygon([polygonPoints, holePoints], {
@@ -81,9 +81,9 @@
81 81 color: 'green'
82 82 });
83 83 group.addLayer(polygon);
84   -
  84 +
85 85 polygon.bindPopup('I am a polygon');
86   -
  86 +
87 87 map.addLayer(group);
88 88
89 89 </script>
24 debug/vector/vector-simple.html
@@ -16,20 +16,12 @@
16 16 <div id="map"></div>
17 17
18 18 <script>
19   - var map = L.map('map')
20   - .setView([51.505, -0.09], 13);
21   -
22   - var cloudmade = L.tileLayer('http://{s}.tile.cloudmade.com/{key}/{styleId}/256/{z}/{x}/{y}.png', {
23   - attribution: 'Map data &copy; 2011 OpenStreetMap contributors, Imagery &copy; 2011 CloudMade',
24   - maxZoom: 18,
25   - key: 'BC9A493B41014CAABB98F0471D759707',
26   - styleId: 997
27   - }).addTo(map);
  19 + var map = L.map('map');
28 20
29 21 var marker = L.marker([51.5, -0.09])
30 22 .bindPopup("<b>Hello world!</b><br />I am a popup.")
31   - .addTo(map)
32   - .openPopup();
  23 + .addTo(map);
  24 + //.openPopup();
33 25
34 26 var circle = L.circle([51.508, -0.11], 500, {color: '#f03', opacity: 0.7})
35 27 .bindPopup("I am a circle.")
@@ -41,6 +33,16 @@
41 33 [51.51, -0.047]])
42 34 .bindPopup("I am a polygon.")
43 35 .addTo(map);
  36 +
  37 + map.setView([51.505, -0.09], 13);
  38 +
  39 + var cloudmade = L.tileLayer('http://{s}.tile.cloudmade.com/{key}/{styleId}/256/{z}/{x}/{y}.png', {
  40 + attribution: 'Map data &copy; 2011 OpenStreetMap contributors, Imagery &copy; 2011 CloudMade',
  41 + maxZoom: 18,
  42 + key: 'BC9A493B41014CAABB98F0471D759707',
  43 + styleId: 997
  44 + }).addTo(map);
  45 +
44 46 </script>
45 47 </body>
46 48 </html>
9 dist/leaflet-src.js
@@ -3588,7 +3588,9 @@ L.Path = L.Class.extend({
3588 3588 this.projectLatlngs();
3589 3589 this._updatePath();
3590 3590
3591   - this._map._pathRoot.appendChild(this._container);
  3591 + if (this._container) {
  3592 + this._map._pathRoot.appendChild(this._container);
  3593 + }
3592 3594
3593 3595 map.on({
3594 3596 'viewreset': this.projectLatlngs,
@@ -4520,6 +4522,9 @@ L.Polyline = L.Path.extend({
4520 4522 _convertLatLngs: function (latlngs) {
4521 4523 var i, len;
4522 4524 for (i = 0, len = latlngs.length; i < len; i++) {
  4525 + if (latlngs[i] instanceof Array && typeof latlngs[i][0] !== 'number') {
  4526 + return;
  4527 + }
4523 4528 latlngs[i] = L.latLng(latlngs[i]);
4524 4529 }
4525 4530 return latlngs;
@@ -4674,7 +4679,7 @@ L.Polygon = L.Polyline.extend({
4674 4679 L.Polyline.prototype.initialize.call(this, latlngs, options);
4675 4680
4676 4681 if (latlngs && (latlngs[0] instanceof Array) && (typeof latlngs[0][0] !== 'number')) {
4677   - this._latlngs = latlngs[0];
  4682 + this._latlngs = this._convertLatLngs(latlngs[0]);
4678 4683 this._holes = latlngs.slice(1);
4679 4684 }
4680 4685 },
2  dist/leaflet.js
1 addition, 1 deletion not shown

0 comments on commit b1db46a

Please sign in to comment.
Something went wrong with that request. Please try again.