[OpenLayers-Users] zindex issue, pinpoint not clickable
Andreas Hocevar
ahocevar at opengeo.org
Mon Feb 13 09:29:12 EST 2012
How do you handle clicks if not through a SelectFeature control? Or
are some of your custom layers Layer.Markers subclasses?
Andreas.
On Mon, Feb 13, 2012 at 3:23 PM, Takako Tucker <Takako.Tucker at bbc.co.uk> wrote:
> Hum... I see.
>
> So basically my baselayer is:
>
> Route = new bbc.mtk.OpenLayers.Layer.Route('Route', {
> style: {
> strokeColor: '#000',
> strokeOpacity: 0.8,
> strokeWidth: 5,
> pointRadius: 0,
> strokeLinecap : 'square',
> }
> });
>
> // Above is a bit of customised code, extension of .Layer.Pinpoints class so the route shows in dotted line.
> // Then I have
>
> var pinPoint = Route.addImage(
> map.getPoint(destObj[i].lon, destObj[i].lat),
> {
> //style the pin points
> title: destObj[i].name,
> width: 20,
> height: 20
> }
> );
> ////// code continues...//////
>
> pinPointList.push(pinPoint);
>
>
> // Above to specify pinpoint styles and add that pinpoints to the route. And this is my baselayer.
>
> //And finally I have
>
> ////// some more code above this//////
>
> topLayer = new OpenLayers.Layer.Vector("Torch Layer", {
> rendererOptions: {zIndexing: true},
> style: {
> externalGraphic: staticUrl + "/desktop/img/map/torch-location.gif",
> graphicWidth: 42,
> graphicHeight: 42
>
> }
> }),
>
> //add the feature to the vector layer
> topLayer.addFeatures(Feature);
>
> //add the vector layer to the map layer
> map.addLayer(topLayer);
>
> // to set the top layer and addLayer to the map.
>
> So do you say I have to create SelectFeature control and pass the baselayer in there?
>
> Takako
>
> -----Original Message-----
> From: Andreas Hocevar [mailto:ahocevar at opengeo.org]
> Sent: 13 February 2012 14:14
> To: Takako Tucker
> Subject: Re: [OpenLayers-Users] zindex issue, pinpoint not clickable
>
> What is the configuration of your SelectFeature control? You have to
> pass an array of the layers you want to select from to the constructor
> - not just the top layer.
>
> Andreas.
>
> On Mon, Feb 13, 2012 at 3:07 PM, Takako Tucker <Takako.Tucker at bbc.co.uk> wrote:
>> Hi Andreas
>>
>> Thanks as always for your input.
>> Actually z-index is working. And yes I've used to have the code suggested:
>>
>> Layer = new OpenLayers.Layer.Vector("top layer", {
>> rendererOptions: {zIndexing: true},
>> style: {...}
>> });
>>
>> The problem is when this vector layer comes on top, the layer underneath can't be clicked on.
>> So at the moment I have
>>
>> 2- a vector layer contains a single pinpoint to state the current position (isBaseLayer:false)
>> 1- route layer shows the route and pinpoints (isBaseLayer:true)
>>
>>
>> So z-index works fine and the layer 2 shows up on top, but I can't click on any of the pinpoints on layer 1.
>> Looks like the layer 2 is covering the whole area. I can double click on the map to zoom in, but the pinpoints can't be clicked...
>>
>> Any idea?
>>
>> Takako
>>
>> -----Original Message-----
>> From: andreas.hocevar at gmail.com [mailto:andreas.hocevar at gmail.com] On Behalf Of Andreas Hocevar
>> Sent: 13 February 2012 14:03
>> To: Takako Tucker
>> Cc: openlayers-users at lists.osgeo.org
>> Subject: Re: [OpenLayers-Users] zindex issue, pinpoint not clickable
>>
>> Hi,
>>
>> you haven't turned zIndexing on. rendererOptions is not a style
>> property, but a layer config option. Try the following:
>>
>> Layer = new OpenLayers.Layer.Vector("top layer", {
>> rendererOptions: {zIndexing: true},
>> style: {...}
>> });
>>
>> Andreas.
>>
>> On Mon, Feb 13, 2012 at 10:05 AM, takakot <takako.tucker at bbc.co.uk> wrote:
>>> I'm having a problem with z-index and wonder you could help.
>>>
>>> I've successfully set z-index using:
>>>
>>>
>>> Layer = new OpenLayers.Layer.Vector("top layer", {
>>> style: {
>>> rendererOptions: { zIndexing: true },
>>> externalGraphic: "/desktop/img/map/location.gif",
>>> graphicWidth: 42,
>>> graphicHeight: 42
>>> }
>>> }),
>>> Layer.setZIndex( 745 );
>>>
>>> So this layer comes on top of other three layers I have.
>>> On the layer underneath this layer, I have different type of pinpoints.
>>> The problem is when the top layer gets displayed; I can't click on any of
>>> those pinpoints on the layer underneath.
>>> It seems to be that the top layer takes over and covers the whole thing and
>>> the layer underneath can't be clicked.
>>>
>>> Have you had any experience with an issue like this? If so, could you please
>>> advice?
>>>
>>> Thanks as always.
>>>
>>> Takako
>>>
>>>
>>> --
>>> View this message in context: http://osgeo-org.1560.n6.nabble.com/zindex-issue-pinpoint-not-clickable-tp4464352p4464352.html
>>> Sent from the OpenLayers Users mailing list archive at Nabble.com.
>>> _______________________________________________
>>> 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.
>>
>> http://www.bbc.co.uk/
>> This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
>> If you have received it in error, please delete it from your system.
>> Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
>> Please note that the BBC monitors e-mails sent or received.
>> Further communication will signify your consent to this.
>>
>
>
>
> --
> Andreas Hocevar
> OpenGeo - http://opengeo.org/
> Expert service straight from the developers.
>
> http://www.bbc.co.uk/
> This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
> If you have received it in error, please delete it from your system.
> Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
> Please note that the BBC monitors e-mails sent or received.
> Further communication will signify your consent to this.
>
--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.
More information about the Users
mailing list