Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
Adysone CreditAttribution: Adysone commentedThe 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.
Comment #2
JMC CreditAttribution: JMC commentedThanks 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).
Comment #3
PolThanks, patch from #1765852: KML/GeoJSON Layer properties not editable/viewable and KML layers not working with OL-2.12 libraries has been committed.