Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: danzel/Leaflet
...
head fork: danzel/Leaflet
Checking mergeability… Don't worry, you can still create the pull request.
  • 19 commits
  • 10 files changed
  • 0 commit comments
  • 2 contributors
Commits on Aug 01, 2012
@danzel Radio buttons properly dynamically created in IE7 don't work, so the …
…layers dialog doesn't work, do it this hacky way instead.
8c84b8a
@mourner mourner Merge pull request #861 from danzel/master
Fix FeatureGroup.removeLayer removing popups
f8f04c3
@mourner mourner Merge pull request #862 from danzel/oldie-fixes
Fix Layers dialog in IE7
985850f
@danzel When removing a marker from a FeatureGroup, only remove the popup if …
…it was put there by the FeatureGroup.

Refs danzel/Leaflet.markercluster#24
a0ee757
@mourner mourner cleanup layers control IE7 fix #861 b3d6427
@danzel Radio buttons properly dynamically created in IE7 don't work, so the …
…layers dialog doesn't work, do it this hacky way instead.
9e61d26
@mourner mourner cleanup layers control IE7 fix #861 690c969
@mourner mourner update build and changelog 2020827
@mourner mourner update build and changelog 4cdece7
@mourner mourner update version in the source 63a6221
@mourner mourner update version number and build 00ed228
@mourner mourner add _site to git ignore f40de07
@danzel Add a page for testing opacity works. b96f23d
@danzel Fix setting opacity multiple times in oldie. Was disabling the filter…
… if it should be enabled and vice-versa
f52251a
Commits on Aug 02, 2012
@mourner mourner Merge pull request #864 from danzel/oldie-fixes
Fix Opacity toggling in oldie
b41a72c
@mourner mourner fix dragging cursor appearing to early on FF 1b88497
@danzel Fix setting opacity multiple times in oldie. Was disabling the filter…
… if it should be enabled and vice-versa
8d4d347
@mourner mourner merge stable, update build cfc5528
@danzel Fix for android 2 tiles d9bafda
View
1  .gitignore
@@ -5,3 +5,4 @@ tmp/**/*
.idea/**/*
*.iml
*.sublime-*
+_site
View
5 CHANGELOG.md
@@ -9,6 +9,11 @@ An in-progress version being developed on the master branch.
* Added optional `animate` argument to `Map` `invalidateSize` (by [@ajbeaven](https://github.com/ajbeaven)). [#857](https://github.com/CloudMade/Leaflet/pull/857)
+## 0.4.2 (August 1, 2012)
+
+ * Fixed a bug where layers control radio buttons would not work correctly in IE7 (by [@danzel](https://github.com/danzel)). [#862](https://github.com/CloudMade/Leaflet/pull/862)
+ * Fixed a bug where `FeatureGroup` `removeLayer` would unbind popups of removed layers even if the popups were not put by the group (affected [Leaflet.markercluster](https://github.com/danzel/Leaflet.markercluster) plugin) (by [@danzel](https://github.com/danzel)). [#861](https://github.com/CloudMade/Leaflet/pull/861)
+
## 0.4.1 (July 31, 2012)
* Fixed a bug that caused marker shadows appear as opaque black in IE6-8. [#850](https://github.com/CloudMade/Leaflet/issues/850)
View
56 debug/tests/opacity.html
@@ -0,0 +1,56 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Leaflet debug page</title>
+
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
+
+ <link rel="stylesheet" href="../../dist/leaflet.css" />
+ <!--[if lte IE 8]><link rel="stylesheet" href="../../dist/leaflet.ie.css" /><![endif]-->
+
+ <link rel="stylesheet" href="../css/mobile.css" />
+ <style>
+ .mybox {
+ background-color: red;
+ }
+
+ </style>
+ <script src="../leaflet-include.js"></script>
+</head>
+<body>
+
+ <div id="map"></div>
+
+ <script type="text/javascript">
+
+ var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/997/256/{z}/{x}/{y}.png',
+ cloudmadeAttribution = 'Map data &copy; 2011 OpenStreetMap contributors, Imagery &copy; 2011 CloudMade',
+ cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18, attribution: cloudmadeAttribution}),
+ latlng = new L.LatLng(50.5, 30.51);
+
+ var map = new L.Map('map', {center: latlng, zoom: 15, layers: [cloudmade]});
+
+ //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' }) });
+ map.addLayer(marker);
+
+ var visible = true;
+ marker.on('click', function () {
+ if (visible) {
+ marker.setOpacity(0.3);
+ marker._icon.innerHTML = 'transparent';
+ } else {
+ marker.setOpacity(1);
+ marker._icon.innerHTML = 'opaque';
+ }
+ visible = !visible;
+ });
+
+ var marker2 = new L.Marker(new L.LatLng(50.5, 30.52));
+ map.addLayer(marker2);
+ marker2.bindPopup('This is an amazing message. I shouldn\'t of deleted the Ipsum text');
+
+
+ </script>
+</body>
+</html>
View
53 dist/leaflet-src.js
@@ -21,7 +21,7 @@ if (typeof exports !== undefined + '') {
window.L = L;
}
-L.version = '0.4.1';
+L.version = '0.4.2';
/*
@@ -756,7 +756,7 @@ L.DomUtil = {
value = Math.round(value * 100);
if (filter) {
- filter.Enabled = (value === 100);
+ filter.Enabled = (value !== 100);
filter.Opacity = value;
} else {
el.style.filter += ' progid:' + filterName + '(opacity=' + value + ')';
@@ -3516,7 +3516,11 @@ L.FeatureGroup = L.LayerGroup.extend({
L.LayerGroup.prototype.removeLayer.call(this, layer);
- return this.invoke('unbindPopup');
+ if (this._popupContent) {
+ return this.invoke('unbindPopup');
+ } else {
+ return this;
+ }
},
bindPopup: function (content) {
@@ -5397,11 +5401,6 @@ L.Draggable = L.Class.extend({
return;
}
- if (!L.Browser.touch) {
- L.DomUtil.disableTextSelection();
- this._setMovingCursor();
- }
-
this._startPos = this._newPos = L.DomUtil.getPosition(this._element);
this._startPoint = new L.Point(first.clientX, first.clientY);
@@ -5423,6 +5422,11 @@ L.Draggable = L.Class.extend({
if (!this._moved) {
this.fire('dragstart');
this._moved = true;
+
+ if (!L.Browser.touch) {
+ L.DomUtil.disableTextSelection();
+ this._setMovingCursor();
+ }
}
this._newPos = this._startPos.add(diffVec);
@@ -6928,16 +6932,35 @@ L.Control.Layers = L.Control.extend({
this._separator.style.display = (overlaysPresent && baseLayersPresent ? '' : 'none');
},
- _addItem: function (obj, onclick) {
- var label = document.createElement('label');
+ // IE7 bugs out if you create a radio dynamically, so you have to do it this hacky way (see http://bit.ly/PqYLBe)
+ _createRadioElement: function (name, checked) {
- var input = document.createElement('input');
- if (!obj.overlay) {
- input.name = 'leaflet-base-layers';
+ var radioHtml = '<input type="radio" name="' + name + '"';
+ if (checked) {
+ radioHtml += ' checked="checked"';
}
- input.type = obj.overlay ? 'checkbox' : 'radio';
+ radioHtml += '/>';
+
+ var radioFragment = document.createElement('div');
+ radioFragment.innerHTML = radioHtml;
+
+ return radioFragment.firstChild;
+ },
+
+ _addItem: function (obj) {
+ var label = document.createElement('label'),
+ input,
+ checked = this._map.hasLayer(obj.layer);
+
+ if (obj.overlay) {
+ input = document.createElement('input');
+ input.type = 'checkbox';
+ input.defaultChecked = checked;
+ } else {
+ input = this._createRadioElement('leaflet-base-layers', checked);
+ }
+
input.layerId = L.Util.stamp(obj.layer);
- input.defaultChecked = this._map.hasLayer(obj.layer);
L.DomEvent.on(input, 'click', this._onInputClick, this);
View
2  dist/leaflet.js
1 addition, 1 deletion not shown
View
2  src/Leaflet.js
@@ -14,4 +14,4 @@ if (typeof exports !== undefined + '') {
window.L = L;
}
-L.version = '0.4.1';
+L.version = '0.4.2';
View
33 src/control/Control.Layers.js
@@ -133,16 +133,35 @@ L.Control.Layers = L.Control.extend({
this._separator.style.display = (overlaysPresent && baseLayersPresent ? '' : 'none');
},
- _addItem: function (obj, onclick) {
- var label = document.createElement('label');
+ // IE7 bugs out if you create a radio dynamically, so you have to do it this hacky way (see http://bit.ly/PqYLBe)
+ _createRadioElement: function (name, checked) {
- var input = document.createElement('input');
- if (!obj.overlay) {
- input.name = 'leaflet-base-layers';
+ var radioHtml = '<input type="radio" name="' + name + '"';
+ if (checked) {
+ radioHtml += ' checked="checked"';
}
- input.type = obj.overlay ? 'checkbox' : 'radio';
+ radioHtml += '/>';
+
+ var radioFragment = document.createElement('div');
+ radioFragment.innerHTML = radioHtml;
+
+ return radioFragment.firstChild;
+ },
+
+ _addItem: function (obj) {
+ var label = document.createElement('label'),
+ input,
+ checked = this._map.hasLayer(obj.layer);
+
+ if (obj.overlay) {
+ input = document.createElement('input');
+ input.type = 'checkbox';
+ input.defaultChecked = checked;
+ } else {
+ input = this._createRadioElement('leaflet-base-layers', checked);
+ }
+
input.layerId = L.Util.stamp(obj.layer);
- input.defaultChecked = this._map.hasLayer(obj.layer);
L.DomEvent.on(input, 'click', this._onInputClick, this);
View
2  src/dom/DomUtil.js
@@ -121,7 +121,7 @@ L.DomUtil = {
value = Math.round(value * 100);
if (filter) {
- filter.Enabled = (value === 100);
+ filter.Enabled = (value !== 100);
filter.Opacity = value;
} else {
el.style.filter += ' progid:' + filterName + '(opacity=' + value + ')';
View
10 src/dom/Draggable.js
@@ -60,11 +60,6 @@ L.Draggable = L.Class.extend({
return;
}
- if (!L.Browser.touch) {
- L.DomUtil.disableTextSelection();
- this._setMovingCursor();
- }
-
this._startPos = this._newPos = L.DomUtil.getPosition(this._element);
this._startPoint = new L.Point(first.clientX, first.clientY);
@@ -86,6 +81,11 @@ L.Draggable = L.Class.extend({
if (!this._moved) {
this.fire('dragstart');
this._moved = true;
+
+ if (!L.Browser.touch) {
+ L.DomUtil.disableTextSelection();
+ this._setMovingCursor();
+ }
}
this._newPos = this._startPos.add(diffVec);
View
6 src/layer/tile/TileLayer.js
@@ -371,9 +371,11 @@ L.TileLayer = L.Class.extend({
var tile = this._getTile();
// Chrome 20 layouts much faster with top/left (Verify with timeline, frames), Safari 5.1.7, iOS 5.1.1,
- // android browser (4.0) have display issues with top/left and requires transform instead
+ // android 4 browser has display issues with top/left and requires transform instead
+ // android 3 browser not tested
+ // android 2 browser requires top/left or tiles disappear on load or first drag (reappear after zoom) https://github.com/CloudMade/Leaflet/issues/866
// (other browsers don't currently care) - see debug/hacks/jitter.html for an example
- L.DomUtil.setPosition(tile, tilePos, L.Browser.chrome);
+ L.DomUtil.setPosition(tile, tilePos, L.Browser.chrome || L.Browser.android23);
this._tiles[tilePoint.x + ':' + tilePoint.y] = tile;

No commit comments for this range

Something went wrong with that request. Please try again.