leaflet-rails 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module Leaflet
2
2
  module Rails
3
- VERSION = "0.6.0"
3
+ VERSION = "0.6.1"
4
4
  end
5
5
  end
@@ -7,7 +7,7 @@
7
7
  var oldL = window.L,
8
8
  L = {};
9
9
 
10
- L.version = '0.6';
10
+ L.version = '0.6.1';
11
11
 
12
12
  // define Leaflet for Node module pattern loaders, including Browserify
13
13
  if (typeof module === 'object' && typeof module.exports === 'object') {
@@ -2335,7 +2335,7 @@ L.Projection.Mercator = {
2335
2335
  lng = point.x * d / r,
2336
2336
  tmp = r2 / r,
2337
2337
  eccent = Math.sqrt(1 - (tmp * tmp)),
2338
- ts = Math.exp(- point.y / r2),
2338
+ ts = Math.exp(- point.y / r),
2339
2339
  phi = (Math.PI / 2) - 2 * Math.atan(ts),
2340
2340
  numIter = 15,
2341
2341
  tol = 1e-7,
@@ -3903,7 +3903,7 @@ L.Popup = L.Class.extend({
3903
3903
  L.DomEvent.disableClickPropagation(wrapper);
3904
3904
 
3905
3905
  this._contentNode = L.DomUtil.create('div', prefix + '-content', wrapper);
3906
- L.DomEvent.on(this._contentNode, 'wheel', L.DomEvent.stopPropagation);
3906
+ L.DomEvent.on(this._contentNode, 'mousewheel', L.DomEvent.stopPropagation);
3907
3907
  L.DomEvent.on(wrapper, 'contextmenu', L.DomEvent.stopPropagation);
3908
3908
  this._tipContainer = L.DomUtil.create('div', prefix + '-tip-container', container);
3909
3909
  this._tip = L.DomUtil.create('div', prefix + '-tip', this._tipContainer);
@@ -6190,11 +6190,6 @@ L.geoJson = function (geojson, options) {
6190
6190
  */
6191
6191
 
6192
6192
  L.DomEvent = {
6193
- WHEEL:
6194
- 'onwheel' in document ? 'wheel' :
6195
- 'onmousewheel' in document ? 'mousewheel' :
6196
- 'MozMousePixelScroll',
6197
-
6198
6193
  /* inspired by John Resig, Dean Edwards and YUI addEvent implementations */
6199
6194
  addListener: function (obj, type, fn, context) { // (HTMLElement, String, Function[, Object])
6200
6195
 
@@ -6215,13 +6210,13 @@ L.DomEvent = {
6215
6210
  this.addDoubleTapListener(obj, handler, id);
6216
6211
  }
6217
6212
 
6218
- if (type === 'wheel' || type === 'mousewheel') {
6219
- type = L.DomEvent.WHEEL;
6220
- }
6221
-
6222
6213
  if ('addEventListener' in obj) {
6223
6214
 
6224
- if ((type === 'mouseenter') || (type === 'mouseleave')) {
6215
+ if (type === 'mousewheel') {
6216
+ obj.addEventListener('DOMMouseScroll', handler, false);
6217
+ obj.addEventListener(type, handler, false);
6218
+
6219
+ } else if ((type === 'mouseenter') || (type === 'mouseleave')) {
6225
6220
 
6226
6221
  originalHandler = handler;
6227
6222
  newType = (type === 'mouseenter' ? 'mouseover' : 'mouseout');
@@ -6261,10 +6256,6 @@ L.DomEvent = {
6261
6256
 
6262
6257
  if (!handler) { return this; }
6263
6258
 
6264
- if (type === 'wheel' || type === 'mousewheel') {
6265
- type = L.DomEvent.WHEEL;
6266
- }
6267
-
6268
6259
  if (L.Browser.msTouch && type.indexOf('touch') === 0) {
6269
6260
  this.removeMsTouchListener(obj, type, id);
6270
6261
  } else if (L.Browser.touch && (type === 'dblclick') && this.removeDoubleTapListener) {
@@ -6272,7 +6263,11 @@ L.DomEvent = {
6272
6263
 
6273
6264
  } else if ('removeEventListener' in obj) {
6274
6265
 
6275
- if ((type === 'mouseenter') || (type === 'mouseleave')) {
6266
+ if (type === 'mousewheel') {
6267
+ obj.removeEventListener('DOMMouseScroll', handler, false);
6268
+ obj.removeEventListener(type, handler, false);
6269
+
6270
+ } else if ((type === 'mouseenter') || (type === 'mouseleave')) {
6276
6271
  obj.removeEventListener((type === 'mouseenter' ? 'mouseover' : 'mouseout'), handler, false);
6277
6272
  } else {
6278
6273
  obj.removeEventListener(type, handler, false);
@@ -6334,16 +6329,15 @@ L.DomEvent = {
6334
6329
  },
6335
6330
 
6336
6331
  getWheelDelta: function (e) {
6332
+
6337
6333
  var delta = 0;
6338
6334
 
6339
- if (e.type === 'wheel') {
6340
- delta = -e.deltaY / (e.deltaMode ? 1 : 120);
6341
- } else if (e.type === 'mousewheel') {
6335
+ if (e.wheelDelta) {
6342
6336
  delta = e.wheelDelta / 120;
6343
- } else if (e.type === 'MozMousePixelScroll') {
6344
- delta = -e.detail;
6345
6337
  }
6346
-
6338
+ if (e.detail) {
6339
+ delta = -e.detail / 3;
6340
+ }
6347
6341
  return delta;
6348
6342
  },
6349
6343
 
@@ -6764,12 +6758,14 @@ L.Map.mergeOptions({
6764
6758
 
6765
6759
  L.Map.ScrollWheelZoom = L.Handler.extend({
6766
6760
  addHooks: function () {
6767
- L.DomEvent.on(this._map._container, 'wheel', this._onWheelScroll, this);
6761
+ L.DomEvent.on(this._map._container, 'mousewheel', this._onWheelScroll, this);
6762
+ L.DomEvent.on(this._map._container, 'MozMousePixelScroll', L.DomEvent.preventDefault);
6768
6763
  this._delta = 0;
6769
6764
  },
6770
6765
 
6771
6766
  removeHooks: function () {
6772
- L.DomEvent.off(this._map._container, 'wheel', this._onWheelScroll);
6767
+ L.DomEvent.off(this._map._container, 'mousewheel', this._onWheelScroll);
6768
+ L.DomEvent.off(this._map._container, 'MozMousePixelScroll', L.DomEvent.preventDefault);
6773
6769
  },
6774
6770
 
6775
6771
  _onWheelScroll: function (e) {
@@ -8128,7 +8124,7 @@ L.Control.Layers = L.Control.extend({
8128
8124
 
8129
8125
  if (!L.Browser.touch) {
8130
8126
  L.DomEvent.disableClickPropagation(container);
8131
- L.DomEvent.on(container, 'wheel', L.DomEvent.stopPropagation);
8127
+ L.DomEvent.on(container, 'mousewheel', L.DomEvent.stopPropagation);
8132
8128
  } else {
8133
8129
  L.DomEvent.on(container, 'click', L.DomEvent.stopPropagation);
8134
8130
  }
@@ -5,6 +5,7 @@
5
5
  .leaflet-marker-icon,
6
6
  .leaflet-marker-shadow,
7
7
  .leaflet-tile-pane,
8
+ .leaflet-tile-container,
8
9
  .leaflet-overlay-pane,
9
10
  .leaflet-shadow-pane,
10
11
  .leaflet-marker-pane,
@@ -27,6 +28,7 @@
27
28
  -webkit-user-select: none;
28
29
  -moz-user-select: none;
29
30
  user-select: none;
31
+ -webkit-user-drag: none;
30
32
  }
31
33
  .leaflet-marker-icon,
32
34
  .leaflet-marker-shadow {
@@ -191,104 +193,108 @@
191
193
  /* general toolbar styles */
192
194
 
193
195
  .leaflet-bar {
194
- box-shadow: 0 0 8px rgba(0,0,0,0.4);
195
- border: 1px solid #888;
196
- -webkit-border-radius: 5px;
197
- border-radius: 5px;
196
+ box-shadow: 0 1px 7px rgba(0,0,0,0.65);
197
+ -webkit-border-radius: 4px;
198
+ border-radius: 4px;
198
199
  }
199
- .leaflet-bar-part {
200
- background-color: rgba(255, 255, 255, 0.8);
201
- border-bottom: 1px solid #aaa;
200
+ .leaflet-bar a, .leaflet-bar a:hover {
201
+ background-color: #fff;
202
+ border-bottom: 1px solid #ccc;
203
+ width: 26px;
204
+ height: 26px;
205
+ line-height: 26px;
206
+ display: block;
207
+ text-align: center;
208
+ text-decoration: none;
209
+ color: black;
202
210
  }
203
- .leaflet-bar-part-top {
204
- -webkit-border-radius: 4px 4px 0 0;
205
- border-radius: 4px 4px 0 0;
211
+ .leaflet-bar a,
212
+ .leaflet-control-layers-toggle {
213
+ background-position: 50% 50%;
214
+ background-repeat: no-repeat;
215
+ display: block;
206
216
  }
207
- .leaflet-bar-part-bottom {
208
- -webkit-border-radius: 0 0 4px 4px;
209
- border-radius: 0 0 4px 4px;
217
+ .leaflet-bar a:hover {
218
+ background-color: #f4f4f4;
219
+ }
220
+ .leaflet-bar a:first-child {
221
+ -webkit-border-top-left-radius: 4px;
222
+ border-top-left-radius: 4px;
223
+ -webkit-border-top-right-radius: 4px;
224
+ border-top-right-radius: 4px;
225
+ }
226
+ .leaflet-bar a:last-child {
227
+ -webkit-border-bottom-left-radius: 4px;
228
+ border-bottom-left-radius: 4px;
229
+ -webkit-border-bottom-right-radius: 4px;
230
+ border-bottom-right-radius: 4px;
210
231
  border-bottom: none;
211
232
  }
233
+ .leaflet-bar a.leaflet-disabled {
234
+ cursor: default;
235
+ background-color: #f4f4f4;
236
+ color: #bbb;
237
+ }
212
238
 
213
239
  .leaflet-touch .leaflet-bar {
214
240
  -webkit-border-radius: 10px;
215
241
  border-radius: 10px;
216
242
  }
217
- .leaflet-touch .leaflet-bar-part {
218
- border-bottom: 4px solid rgba(0,0,0,0.3);
219
- }
220
- .leaflet-touch .leaflet-bar-part-top {
221
- -webkit-border-radius: 7px 7px 0 0;
222
- border-radius: 7px 7px 0 0;
243
+ .leaflet-touch .leaflet-bar a {
244
+ width: 30px;
245
+ height: 30px;
223
246
  }
224
- .leaflet-touch .leaflet-bar-part-bottom {
225
- -webkit-border-radius: 0 0 7px 7px;
226
- border-radius: 0 0 7px 7px;
247
+ .leaflet-touch .leaflet-bar a:first-child {
248
+ -webkit-border-top-left-radius: 7px;
249
+ border-top-left-radius: 7px;
250
+ -webkit-border-top-right-radius: 7px;
251
+ border-top-right-radius: 7px;
252
+ }
253
+ .leaflet-touch .leaflet-bar a:last-child {
254
+ -webkit-border-bottom-left-radius: 7px;
255
+ border-bottom-left-radius: 7px;
256
+ -webkit-border-bottom-right-radius: 7px;
257
+ border-bottom-right-radius: 7px;
227
258
  border-bottom: none;
228
259
  }
229
260
 
230
261
 
231
262
  /* zoom control */
232
263
 
233
- .leaflet-container .leaflet-control-zoom {
234
- margin-left: 13px;
235
- margin-top: 12px;
236
- }
237
- .leaflet-control-zoom a {
238
- width: 22px;
239
- height: 22px;
240
- text-align: center;
241
- text-decoration: none;
242
- color: black;
243
- }
244
- .leaflet-control-zoom a,
245
- .leaflet-control-layers-toggle {
246
- background-position: 50% 50%;
247
- background-repeat: no-repeat;
248
- display: block;
249
- }
250
- .leaflet-control-zoom a:hover {
251
- background-color: #fff;
252
- color: #777;
253
- }
254
264
  .leaflet-control-zoom-in {
255
- font: bold 18px/24px Arial, Helvetica, sans-serif;
265
+ font: bold 18px 'Lucida Console', Monaco, monospace;
256
266
  }
257
267
  .leaflet-control-zoom-out {
258
- font: bold 23px/20px Tahoma, Verdana, sans-serif;
259
- }
260
- .leaflet-control-zoom a.leaflet-control-zoom-disabled {
261
- cursor: default;
262
- background-color: rgba(255, 255, 255, 0.8);
263
- color: #bbb;
268
+ font: bold 22px 'Lucida Console', Monaco, monospace;
264
269
  }
265
270
 
266
- .leaflet-touch .leaflet-control-zoom a {
267
- width: 30px;
268
- height: 30px;
269
- }
270
271
  .leaflet-touch .leaflet-control-zoom-in {
271
- font-size: 24px;
272
- line-height: 29px;
272
+ font-size: 22px;
273
+ line-height: 30px;
273
274
  }
274
275
  .leaflet-touch .leaflet-control-zoom-out {
275
276
  font-size: 28px;
276
- line-height: 24px;
277
+ line-height: 30px;
277
278
  }
278
279
 
280
+
279
281
  /* layers control */
280
282
 
281
283
  .leaflet-control-layers {
282
284
  box-shadow: 0 1px 7px rgba(0,0,0,0.4);
283
285
  background: #f8f8f9;
284
- -webkit-border-radius: 8px;
285
- border-radius: 8px;
286
+ -webkit-border-radius: 5px;
287
+ border-radius: 5px;
286
288
  }
287
289
  .leaflet-control-layers-toggle {
288
290
  background-image: url(<%= asset_path 'layers.png' %>);
289
291
  width: 36px;
290
292
  height: 36px;
291
293
  }
294
+ .leaflet-retina .leaflet-control-layers-toggle {
295
+ background-image: url(<%= asset_path 'layers-2x.png' %>);
296
+ background-size: 26px 26px;
297
+ }
292
298
  .leaflet-touch .leaflet-control-layers-toggle {
293
299
  width: 44px;
294
300
  height: 44px;
@@ -386,11 +392,11 @@
386
392
  .leaflet-popup-content-wrapper {
387
393
  padding: 1px;
388
394
  text-align: left;
389
- -webkit-border-radius: 20px;
390
- border-radius: 20px;
395
+ -webkit-border-radius: 12px;
396
+ border-radius: 12px;
391
397
  }
392
398
  .leaflet-popup-content {
393
- margin: 14px 20px;
399
+ margin: 13px 19px;
394
400
  line-height: 1.4;
395
401
  }
396
402
  .leaflet-popup-content p {
@@ -404,11 +410,11 @@
404
410
  overflow: hidden;
405
411
  }
406
412
  .leaflet-popup-tip {
407
- width: 15px;
408
- height: 15px;
413
+ width: 17px;
414
+ height: 17px;
409
415
  padding: 1px;
410
416
 
411
- margin: -8px auto 0;
417
+ margin: -10px auto 0;
412
418
 
413
419
  -webkit-transform: rotate(45deg);
414
420
  -moz-transform: rotate(45deg);
@@ -425,7 +431,7 @@
425
431
  position: absolute;
426
432
  top: 0;
427
433
  right: 0;
428
- padding: 4px 5px 0 0;
434
+ padding: 4px 4px 0 0;
429
435
  text-align: center;
430
436
  width: 18px;
431
437
  height: 14px;
@@ -35,12 +35,6 @@
35
35
  .leaflet-control-layers {
36
36
  border: 3px solid #999;
37
37
  }
38
- .leaflet-control-zoom a {
39
- background-color: #eee;
40
- }
41
- .leaflet-control-zoom a:hover {
42
- background-color: #fff;
43
- }
44
38
  .leaflet-control-layers-toggle {
45
39
  }
46
40
  .leaflet-control-attribution,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leaflet-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-26 00:00:00.000000000 Z
12
+ date: 2013-07-16 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: This gem provides the leaflet.js map display library for your Rails 3
15
15
  application.