I've been trying to add a kml layer to a map. All I get is TypeError: Object #

has no method 'loadURL' openlayers.js:106. I was using the current version of openlayers from their site and I read that the loadURL method was being depreciated. So I put the 2.11 version on my site, and it worked. Line 24 of openlayers_layer_type_kml.js is making this call of the openlayers library. Thank you.

Comments

Adysone’s picture

The loadURL function of OpenLayers library is no longer supported.
You must include the deprecated.js file, available in /libraries/OpenLayers-2.12/lib folder.

The call of the OpenLayers.loadURL() function must be replaced by the new OpenLayers.Request.GET() function.
openlayers/plugins/layer_types/openlayers_layer_type_geojson.js (1 hits)
Line 54: OpenLayers.loadURL(options.url, {}, null, function (response)...
openlayers/plugins/layer_types/openlayers_layer_type_kml.js (1 hits)
Line 24: OpenLayers.loadURL(options.url, {}, null, function (response)...

Due to a very lot deprecated functions in openLayers 2.12, it would be glad if the Drupal OpenLayers Module can be cleaned.

JMC’s picture

Status: Active » Needs review

Thanks for the info Adysone.
I've had the same problem logged here http://drupal.org/node/1765852 so I've created a patch (attached to that issue).

Pol’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.