Stephen Brooke | 22 Oct 07:00 2014

Receive "Uncaught TypeError" from OpenLayers.Event.observe method when zoom in while processing WMS request from previous zoom operation

Hi list,

I am using OpenLayers 2.13.1.


I am experiencing a problem when zoom in/out while OpenLayers is in process of loading images from several WMS requests that resulted from a previous zoom operation.


Uncaught TypeError: Cannot read property '_eventCacheID' of null                         OpenLayers.debug.js:5178                                         

OpenLayers.Event.observe                                                                                                        OpenLayers.debug.js:5178                                         

tile.onLoadEnd                                                                                                                                 OpenLayers.debug.js:31046                       

OpenLayers.Events.OpenLayers.Class.triggerEvent                                                                        OpenLayers.debug.js:5812                                         

OpenLayers.Tile.OpenLayers.Class.unload                                                                          OpenLayers.debug.js:29266                       

OpenLayers.Tile.Image.OpenLayers.Class.draw                                                                OpenLayers.debug.js:29584                       

OpenLayers.Layer.Grid.OpenLayers.Class.initGriddedTiles                                          OpenLayers.debug.js:30957                       

OpenLayers.Layer.Grid.OpenLayers.Class.moveTo                                                         OpenLayers.debug.js:30428                       

OpenLayers.Map.OpenLayers.Class.moveTo                                                                     OpenLayers.debug.js:9299                                         

map.zoomTween.start.callbacks.done                                                                                  OpenLayers.debug.js:9682                                         

OpenLayers.Tween.OpenLayers.Class.stop                                                                        OpenLayers.debug.js:6697                                                                                                          OpenLayers.debug.js:6730                                         

(anonymous function)                                                                                                                  OpenLayers.debug.js:615                                           

loops.(anonymous function)                                                                                                     OpenLayers.debug.js:6528



I am having an extremely difficult time trying to determine what my app is doing to make OpenLayers react this way.  The effect of the error is that zoom in/out capability breaks on the map until I reload the page.

Can someone enlighten me as to what may be going on here?



More background on the problem:


One way I have been able to avoid the problem, although it is not an acceptable solution, is to add the following code near the top of the “OpenLayers.Event.observe” method:


        if (element == null){

                //console.log("element: " + element + ", name: " + name + ", observer: " + observer + ", " + "useCapture: " + useCapture);




Like this:



     * Method: observe


     * Parameters:

     * elementParam - {DOMElement || String}

     * name - {String}

     * observer - {function}

     * useCapture - {Boolean}


    observe: function(elementParam, name, observer, useCapture) {

        var element = OpenLayers.Util.getElement(elementParam);

        useCapture = useCapture || false;


       //Begin added lines

        if (element == null){

                //console.log("element: " + element + ", name: " + name + ", observer: " + observer + ", " + "useCapture: " + useCapture);



       //End added lines


        if (name == 'keypress' &&


           || element.attachEvent)) {

            name = 'keydown';



        //if observers cache has not yet been created, create it

        if (!this.observers) {

            this.observers = {};



        //if not already assigned, make a new unique cache ID

        if (!element._eventCacheID) {                         ç============= This is the line the error occurs because “element” is null

            var idPrefix = "eventCacheID_";

            if ( {

                idPrefix = + "_" + idPrefix;


            element._eventCacheID = OpenLayers.Util.createUniqueID(idPrefix);




Users mailing list
Thomas Wagner | 21 Oct 14:01 2014

Re: Control a OpenLayer 3 Map per Keys

Here is my jsfiddle link:
Pol <> hat am 21. Oktober 2014 um 13:45 geschrieben:

You should use jsfiddle to create an online example.

On Oct 21, 2014 1:38 PM, "Tomcom" < tom-/> wrote:
I am going to switch from OL2 to OL3.
Using my Map on a SmartPhone is pretty cool but on a classic computer I am
not able to contol the map by using keys (up,down,left,right,+,-).
Several Google links dealing with like won't have any effect on my map.
I can't enable keyboard actions and also can't disable the map rotation on

So here is my HTML-Code:
Any idea what is wrong.


View this message in context:
Sent from the OpenLayers Users mailing list archive at
Users mailing list

Users mailing list
Tomcom | 21 Oct 13:38 2014

Control a OpenLayer 3 Map per Keys

I am going to switch from OL2 to OL3.
Using my Map on a SmartPhone is pretty cool but on a classic computer I am
not able to contol the map by using keys (up,down,left,right,+,-).
Several Google links dealing with like won't have any effect on my map.
I can't enable keyboard actions and also can't disable the map rotation on

So here is my HTML-Code:
Any idea what is wrong.


View this message in context:
Sent from the OpenLayers Users mailing list archive at
simulsys | 14 Oct 16:07 2014

Neither Markers nor Features show markers with version 2.13


I have tried a large number of advised standard methods over two days of
adding markers to a new vector layer, using addMarker and addFeatures, but I
have not seen a marker at all, using Opera, IE and Chrome.

I am using Openlayers 2.13 (I think?) in Microsoft Visual Studio Express for
Web 2013 on an Acer i5 with Windows 8.1, and my base layer is a Bing map.

The layer shows up on the LayerHandler, ticked, but no markers.

As I said, I have tried known methods to no avail, and I am concerned that
as this is not browser-specific, it might be compatibility at some level?

Can anyone recommend a method of adding a marker which works, please? Or at
least a direction to look?

All the best,

View this message in context:
Sent from the OpenLayers Users mailing list archive at
VictoriaH | 12 Oct 20:14 2014

Sugggestions for implementing raster time series


I am currently trying to build a web application in OpenLayers that will
allow a user to either 1. select a date from a dropdown and have the map
display a raster image with an indexed date; or 2. use a slider to drag to
show the rasters associated with the indexed dates. 

On the backend, I have tried for weeks to get a Geoserver imagemosaick
plugin to load my series of geotiff images...nothing but endless
problems...about ready to give up on geoserver. I can use mapserver as an
alternative, as I have experience setting up a time-enabled raster layer...

On the front end, I want to use a javascript module that is easy to
understand...I have seen documentation for jquery slider, jquery ui and
layout....I would like to know what combination of tools users might have
experience with for serving time series raster data, and a front end that
can easily allow selecting dates and even building animations.. I would
appreciate being able to look at code examples for doing this with one of
the javascript modules...

Thanks, Vick

View this message in context:
Sent from the OpenLayers Users mailing list archive at
Jelmer Baas | 10 Oct 14:47 2014

OL3 and Cesium

Hi All,

I was just toying around with WebGL Earth, and thought it would be fun to see what the current state of OL3 and
Cesium is. 

Unfortunately, I haven't been able to find a working example, yet. I found: (broken)!topic/ol3-dev/riAsUwiFOrw (old) (yay!) (broken) (static) (incomplete)

Can someone please point me in the right direction?

Jelmer Baas
Ismail, Mark | 10 Oct 12:12 2014

WMSGetFeatureInfo request to geoserver too sensitive

I am using openlayers 2 and issuing a WMSGetFeatureInfo request to geoserver


It works fine but It is far to sensitive to where you click – if you don’t get right in the centre of a point or icon it finds nothing, it can take 2 or 3 attempts to get a response even if clicking carefully and zoomed in


Is there any way to make that click “less sensitive” so it will pick up the closest point  to the mouse click ?


Mark Ismail


This e-mail and any attachments are confidential. It may contain privileged information and is intended for the named recipient(s) only. It must not be distributed without consent. If you are not one of the intended recipients, please notify the sender immediately and do not disclose, distribute, or retain this email or any part of it and do not take any action based on it.

Unless expressly stated, opinions in this email are those of the individual sender, and not of Knowsley MBC. Legally binding obligations can only be created for, or be entered into on behalf of, Knowsley MBC by duly authorised officers or representatives.

Knowsley MBC excludes any liability whatsoever for any offence caused, any direct or consequential loss arising from the use, or reliance on, this e-mail or its contents. We believe but do not warrant that this e-mail and any attachments are virus free. You must therefore take full responsibility for virus checking and no responsibility is accepted for loss or damage arising from viruses or changes made to this message after it was sent. Knowsley MBC reserves the right to monitor and/or record all e-mail communications through its network in accordance with relevant legislation.
Users mailing list
maven apache | 10 Oct 04:20 2014

Viewport pixel and lonlat transformation problem


I am using Ol 2.13.1,and  I found that  the transformation from viewport pixel to lonlat may result in unexpected result, for example, the following two lines should give the same result, but sometimes not.; OpenLayers.Pixel(map.size.w/2,map.size.h/2)));
And it seems that once you drag and drop the map quickly to make the "kinetic" work, then you will get different result, once you drag the map slowly(which does not cause the "kinetic", you will get the same result.

Live example:
I know this can be fixed by disabling the "kinetic" feature, but I wonder if it is possible with the feature enabled?
Users mailing list
Luís de Sousa | 8 Oct 15:48 2014

WFS layer not being portrayed in map canvas

Dear all,

I have a "rich" application (OL 2.13 + GeoExt 1) where some layers
must be styled dynamically according to user input. I am able to add a
vector layer using WFS and then apply a style rule. Recently some
users started complaining the feature is not working. Eventually I
found out some WFS layers are not being portrayed in the map canvas by

Below is a minimum example with a simple map and one of the
problematic layers. After loading all objects the debugger shows a
vector layer within the map object; this vector layer is reporter as
visible and with the drawn property set to true. In the features array
there are 8 objects as expected, but there is nothing visible in the
map. There are no errors reported in the console.

I am able to display this same layer through WFS in QGIS and access
all its attributes without trouble.

What is going wrong here? Thank you,



 <script type="text/javascript"
 <link rel="stylesheet" type="text/css"

 <script type="text/javascript">

function initMap()
    // Do not forget to add to the proxy's
allowed addresses
    OpenLayers.ProxyHost = "http://localhost/cgi-bin/proxy.cgi?url=";

    var mapProjection = "EPSG:31467";
    var mapServicePath =

    var bounds = new OpenLayers.Bounds(3500000,5410000,3525000,5425000);

    map = new OpenLayers.Map("MiniMap",{
        projection: new OpenLayers.Projection(mapProjection),
        units: "m",
        maxExtent: bounds,

    map.addControl(new OpenLayers.Control.LayerSwitcher());

    var cityWMS =  new OpenLayers.Layer.WMS(
        {layers: "LB_urban_landuse",
         format: "image/png",
         srsName: mapProjection,
          transparent: "true",
          projection: new OpenLayers.Projection(mapProjection)},
        {isBaseLayer: true,
          visibility: true}

    var testWFS = new OpenLayers.Layer.Vector("testWFS", {
        strategies: [new OpenLayers.Strategy.Fixed()],
        projection: new OpenLayers.Projection("EPSG:31467"),
         visibility: true,
        protocol: new OpenLayers.Protocol.WFS({
            version: "1.1.0",
            featureNS: "",
            featureType: "LB_sliders_test",
            srsName: "EPSG:31467"

    map.addLayers([cityWMS, testWFS]);
       map.setCenter(new OpenLayers.LonLat(3514100,5417800), 7);


 <body onLoad="initMap();" style="margin:0px">
     <div  style="width:800px; height:600px; background:white"
     <input type=button value="Click for debugger" onclick="debugger;"></input>
Users mailing list
Users <at>
Bistrais, Bob | 1 Oct 21:56 2014

assertion failed

I’m having a problem trying to build an application with OL3.  I’m trying to use my own WMS layers.  I can get this to display, pan and zoom, but when I try a GetFeatureInfo, my FireBug gives the following error:

AssertionError: Assertion failed


Here is the URL request:



I don’t think there’s much to go on here, but was wondering if anyone has any suggestions on what I might look for?



Users mailing list
Pedro Costa | 1 Oct 17:42 2014

openlayers drag control returns wrong XY coords

Hi guys,

I'm trying to use a Drag Control in a webgis. My problem begins when i 
finish the 'move' of a point. That is, originally the point have XY like 
-8.308567019533697 and 41.376871762432685 displaying well in the map. 
After the move, the point have XY like 49.01610355274739 and 
-293.0306348131995 displaying very far from the rigth place.

My map: var opcoes = {units: 'm', projection: 
extent_maximo,controls: []};

                   map = new OpenLayers.Map('map',opcoes);

The layer of the drag control:

             var localizador = new 
OpenLayers.Layer.Vector("Localizador", { isBaseLayer: false, styleMap: 
new OpenLayers.StyleMap({ 'default': est_loc_def, "temporary": 
est_loc_temp }), displayInLayerSwitcher: false});