[OpenLayers-Users] OL 2.13 generate unused html tags for PanControl

Andreas Hocevar ahocevar at opengeo.org
Mon Jul 15 05:41:53 PDT 2013


A Control.Panel is a control that wraps other controls. So for each control
that you add to a panel, you will get a div in the panel in addition to the
control's own div. Not saying that this makes sense, just saying that's the
way it is.

Andreas.


On Mon, Jul 15, 2013 at 2:15 PM, maven apache <apachemaven0 at gmail.com>wrote:

> But why the PanZoomBarControl does not generate the codes?
>
>
> 2013/7/15 Andreas Hocevar <ahocevar at opengeo.org>
>
>> This is a known oddity of OpenLayers 2. The reason is that controls are
>> designed to have a UI, and what you're seeing is the UI container. It is
>> created even if it is not used.
>>
>> Andreas.
>>
>>
>> On Mon, Jul 15, 2013 at 2:38 AM, maven apache <apachemaven0 at gmail.com>wrote:
>>
>>> Hi:
>>>
>>> I am using OpenLayers 2.13, and I create a simple map with just one
>>> PanControl, however I found that the generated html tags contains some
>>> unused codes.
>>>
>>> This is the codes:
>>>
>>> this.map = new OpenLayers.Map(container, {
>>> "projection" : "EPSG:4490",
>>>  "controls" : []
>>> });
>>>
>>> this.controls = {};
>>>  this.controls.drag = new OpenLayers.Control.Navigation({
>>> "dragPanOptions" : {
>>> "enableKinetic" : true
>>>  }
>>> });
>>> this.controls.p = new OpenLayers.Control.PanPanel({});
>>>  var cons = [ this.controls.drag, this.controls.p ];
>>> this.map.addControls(cons);
>>>
>>> And this is generated tags <http://snag.gy/FkGE2.jpg>.
>>>
>>> Note the tags inside the red rectangle, it seems that these tags are
>>> unused.
>>>
>>> Do I miss anything?
>>>
>>>
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>>>
>>>
>>
>>
>> --
>> Andreas Hocevar
>> OpenGeo - http://opengeo.org/
>> Expert service straight from the developers.
>>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
>


-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130715/81e06024/attachment.html>


More information about the Users mailing list