I have a map with Views data layers. If I turn on the data layer in the Preset, the map breaks in IE7.

Error during map rendering: [object Error]

Clues:
* I am using cloudmade map, but I switched back to the google map, and that didn't help. I don' t think this is really the map rendering.
* I am using the openlayers-dev. Had the same problem with -dev as -alpha9.
* Am using the 2.9 api version of the openlayers core js.
* I turned off all my behaviors.
* Haven't tested in IE8.
* My IE debugging environment is a very unfortunate combination of crossover ie7 with no useful debugging, and parallels with debugging but no access to my localhost.
* I do have some styles, stored in features. I reverted to the 'Default Style' though, so this shouldn't matter.
* The settings for the map are stored in a feature. I have checked that it is properly reverted.
* I am writing my own behaviors, but I have disabled those modules. I cleared caches, so I don't think it's me.
* I am on the lookout for objects looking like this: { var, var, var, } ... but haven't seen any yet.

Questions:
I saw some advice about 'maxExtent' needing to be set...don't know if this is necessary...but if I need to set it, how/where do I do that. Is that the same as 'restrict Extent' to the box?

In trying to debug this, I narrowed down the breaking to this line (commented below)... have some further ideas on going deeper into this, but starting an issue in case anyone has an idea. It is starting to look like it could be a bug, but I haven't ruled out my own error. I'll be doing more of that today.

My next thing will be to make a new testing environment with OL and a new view in a brand new Drupal site to see if this is an OL bug.

Please let me know if you have any ideas.
Thanks!

// $Id: openlayers_views_vector.js,v 1.1.2.5 2010/03/25 14:40:55 tmcw Exp $

/**
 * OpenLayers Views Vector Layer Handler
 */
Drupal.openlayers.layer.openlayers_views_vector = function(title, map, options) {
  // Note, so that we do not pass all the features along to the Layer
  // options, we use the options.options to give to Layer
  options.options.drupalID = options.drupalID;
 
  // Create projection
  options.projection = new OpenLayers.Projection('EPSG:'+options.projection);
  // Get style map
  options.options.styleMap = Drupal.openlayers.getStyleMap(map, options.drupalID);
  // Create layer object

// -----------------THIS IS THE LINE WHERE IT BREAKS:
// * The options.options seems to have some values  & it *does* seem to be able to build a style map in IE
// * Perhaps the style object is built incorrectly... I'll check this next.


  var layer = new OpenLayers.Layer.Vector(title, options.options);
 
  // Add fetures if there are any
  if (options.features) {
    Drupal.openlayers.addFeatures(map, layer, options.features);
  }
 
  return layer;
};

Comments

zzolo’s picture

Hey @chachasikes. thanks for all the helpful information. Still, it will probably best to get some sort of JS debugging going in IE, so that we can start with an actual error message. Keep up the good work.

chachasikes’s picture

Thx zzolo for your help.

Update:
This is the oh-so-helpful Error Message, from IE8*:
LOG: Error: Invalid argument. :/

*We're mainly focusing on IE8 now, and it turns out IE8 is indeed broken too...(or is it...)

I did get a debugger (my Parallels was missing the Bonjour Print Services application...which connects it to my localhost.

Anyhow, I have gone down a rabbit hole into the guts of OpenLayers (2.9.1) - only to track the problem down into assignRenderer... which in IE is trying to render VML and it's crashing there.

Not sure if it is my browser or what...

tmcw’s picture

Ah, yes. It sounds like you might want to read this document: http://drupalcode.org/viewvc/drupal/contributions/modules/openlayers/doc...

chachasikes’s picture

Status: Active » Closed (won't fix)

Why yes, yes that helps very much.

I had turned off a bazillion extra modules, and disabled the theme (which had some image overrides)...and THEN the map worked (revealing opacity problems! but now I can see how to fix those too. Sweet.)

And probably now folks googling the error will find this page & that document. Then people will not suffer as I have.

Closing the issue.