Commit Graph

17 Commits

Author SHA1 Message Date
Daniel Ritz
0af11b064e Fix attribution text not removed when Layer is removed from map
Symptom: Switching between layers with different attributions does
not remove the attribution from the previously selected layer.

Control.Attribution keeps track of its attributions with a counter for
each text. The problem described in #4285 is that each time the layer
is added to the map, the counter is increased by two. It's because
Layer calls Control.Attribution.addAttribution() twice, once from
addLayer() and the second time via the whenReady() callback _layerAdd().
This was not caught by the tests since the callback was never fired
(missing map.setView() call).

Fixes #4285
2016-03-01 13:46:40 +01:00
Iván Sánchez Ortega
663978227d Unit tests for #4257, attributionControl layeradd/layerremove 2016-02-18 21:31:00 +01:00
Iván Sánchez Ortega
63970e9b6c Better cleanup of L.Control.Layers, fixes #4213 (plus unit tests) 2016-02-09 15:43:03 +01:00
Vladimir Agafonkin
cfdbd10431 enforce indentation in specs 2015-09-25 13:55:37 +03:00
Yohan Boniface
08674721bc Fix baselayerchange event argument (fix #3677) 2015-07-27 15:41:07 +02:00
John Firebaugh
87c7d1d563 No-op Control#remove if not on a map (fixes #2877) 2014-11-13 11:25:49 -08:00
John Firebaugh
0b86fa3266 Remove control from existing map in onAdd (fixes #3020) 2014-11-13 10:49:43 -08:00
Vladimir Agafonkin
91c039b7aa jshinting and major clean up of specs code, ref #2151 2013-11-07 23:54:33 +02:00
Tom MacWright
a2f7d7e834 Use mocha 2013-04-03 14:50:09 -07:00
John Firebaugh
01332ebead Omit "should" in spec descriptions
The rationale is this: the spec string describes the expected
behavior unconditionally. The code examples, on the other hand,
set up an expectation that is tested with the call to the expect
method. The code examples can violate the expectation, but the
spec string does not. The value of the spec string is as clearly
as possible describing the behavior. Including “should” in that
description adds no value. (From http://rubyspec.org/style_guide/)
2013-02-19 12:41:48 -08:00
Tom MacWright
0a2000166a Fix semicolons, breaking, whitespace, duplicate var statements. 2013-02-19 11:18:15 -05:00
Vladimir Agafonkin
5d41efe616 fix removeAttrubution, cover the control with tests, close #1410 2013-02-19 17:47:38 +02:00
Vladimir Agafonkin
0c5f401220 Merge pull request #1159 from moonlite/master
First stab at a fix for Issue 623
2012-11-29 06:44:25 -08:00
Tom Hughes
0b2a31c1fe Update the Layers control when layers are added or removed 2012-11-24 00:33:57 +00:00
Mattias Bengtsson
c0135a219d Added a bunch of tests and fixed some bugs those exposed.
Also don't try to automatically adjust zoom. Leave that to the
layer control for now and wait for a setBaseLayer / switchLayer
or something instead.
2012-11-19 04:36:13 +01:00
John Firebaugh
0b4d2b0c44 Add Map#whenReady
Fixes #1063
2012-10-12 12:54:13 -07:00
John Firebaugh
5ee7113fe4 Add a baselayerchange event 2012-10-12 12:19:21 -07:00