[MapQuery] mqLayerManager: visibility checkbox doesn't work
Giuseppe De Marco
peppelinux at yahoo.it
Sat May 19 12:19:39 EDT 2012
I patched this issue in a quick way.
The problem is that when the layer beign hidden mqlayermanager add a css attribute: visibility->hidden.
When the user increase the opacity of the layer, mplayermanager instead of remove visibility attribute leave it and append a new opacity attribute.
I abandoned the visibility approach and I patched in jquery.mapquery.mqLayerManager.js, at line 260, with this:
//update legend image
layerElement.find('.mq-layermanager-element-legend img').css(
{opacity:layer.visible()?true:0});
},
as commented in
https://github.com/mapquery/mapquery/pull/17
Volker sorry if my approach is almost rude but I've no Time to understand appropriately all the signals/events for manage the widget in a elegant way.
Now I'd want to patch the RootContainer...
________________________________
Da: Volker Mische <volker.mische at gmail.com>
A: Giuseppe De Marco <peppelinux at yahoo.it>
Cc: "mapquery at lists.osgeo.org" <mapquery at lists.osgeo.org>
Inviato: Mercoledì 16 Maggio 2012 17:28
Oggetto: Re: [MapQuery] mqLayerManager: visibility checkbox doesn't work
It's indeed a bug, but as it was so simple I fixed it:
https://github.com/mapquery/mapquery/pull/17
Please leave a comment if it works for you, then I'll merge it.
BTW: The code of the LayerManager is not really that good, it could
simplified a lot. I'd be happy if anyone would refactor it :)
Cheers,
Volker
On 05/16/2012 05:06 PM, Giuseppe De Marco wrote:
> Yes, you're right
>
> that's my mistake.
> Now layer set visibility to false when checkbox is unchecked but label
> doesn't back visibile when layer has been activated later.
>
> know bug or something missing again ?
>
> Thank You Volker
>
> ------------------------------------------------------------------------
> *Da:* Volker Mische <volker.mische at gmail.com>
> *A:* Giuseppe De Marco <peppelinux at yahoo.it>
> *Cc:* "mapquery at lists.osgeo.org" <mapquery at lists.osgeo.org>
> *Inviato:* Mercoledì 16 Maggio 2012 16:26
> *Oggetto:* Re: [MapQuery] mqLayerManager: visibility checkbox doesn't work
>
> Hi Giuseppe,
>
> have you checkout also the dependencies? It sounds like the
> jquery.tmpl.js plugin is missing.
>
> Cheers,
> Volker
>
> On 05/16/2012 03:31 PM, Giuseppe De Marco wrote:
>> Hi Volker,
>>
>> the last version of mapquery raises this error:
>>
>> jquery.mapquery.mqLayerManager.js:37
>>
> <http://localhost:8080/JsLib/mapquery-0.1/jquery.mapquery.mqLayerManager.js>Uncaught
>> TypeError: Object function (a,b){return new e.fn.init(a,b,h)} has no
>> method 'template'
>>
>> The old version not
>>
>> ------------------------------------------------------------------------
>> *Da:* Volker Mische <volker.mische at gmail.com
> <mailto:volker.mische at gmail.com>>
>> *A:* Giuseppe De Marco <peppelinux at yahoo.it <mailto:peppelinux at yahoo.it>>
>> *Cc:* "mapquery at lists.osgeo.org <mailto:mapquery at lists.osgeo.org>"
> <mapquery at lists.osgeo.org <mailto:mapquery at lists.osgeo.org>>
>> *Inviato:* Mercoledì 16 Maggio 2012 11:59
>> *Oggetto:* Re: [MapQuery] mqLayerManager: visibility checkbox doesn't work
>>
>> On 05/15/2012 10:43 PM, Giuseppe De Marco wrote:
>>> I noticied that the visibility checkbox doesn't work.
>>> First I thought that was the Jquery I use but later I saw this behavior
>>> in http://mapquery.org/demo/ too.
>>>
>>> Is it a feature that needs to be developed yet ?
>>
>> Hi Giuseppe,
>>
>> this was indeed a bug. Though it is fixed in the most recent version.
>> Please checkout the most recent one from Github [1].
>>
>> [1] https://github.com/mapquery/mapquery
>>
>> Cheers,
>> Volker
>>
>>
>>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapquery/attachments/20120519/5c5238ac/attachment.html
More information about the MapQuery
mailing list