I have this code and some of the time,(not always!!), i have a dialogue that get

displayed in the middle of the map:

Google Maps

Map data (c)2012 Google

   var map;
   var vectors;
   var epsg900913 = new OpenLayers.Projection('EPSG:900913');
   var epsg4326 = new OpenLayers.Projection('EPSG:4326');

   function initialize() {
       var control, renderer=OpenLayers.Util.getParameters(window.location.href).renderer;
       renderer= (renderer) ? [renderer] : OpenLayers.Layer.Vector.prototype.renderers;
       // Create the map object
       map = new OpenLayers.Map('map');
        //Create a Google layer
       var gmap = new OpenLayers.Layer.Google(
           "Google Streets", // the default
             {numZoomLevels: 20}
       var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
                "http://vmap0.tiles.osgeo.org/wms/vmap0?", {layers: 'basic'});

       vectors= new OpenLayers.Layer.Vector(
          "Vector Layer",


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

       control=new OpenLayers.Control.DrawFeature(vectors,OpenLayers.Handler.Path);
       // Zoom to Vancouver, BC
       map.setCenter(new OpenLayers.LonLat(-123.12, 49.28).transform(epsg4326, epsg900913), 13);         

Does anyone know where is this coming from?

Thanks in advance.


It's the same behaviour as reported here: How to close watermarks window in QGIS Openlayers plugin?

It's reported here: http://trac.osgeo.org/openlayers/ticket/2984

and solved here: https://github.com/openlayers/openlayers/commit/92f04a7a4277a6c818ef2d40a2856910ed72d3d6

So, either try the nightly build of openLayers, wait for next release, or apply the patch yourself.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.