Closed (fixed)
Project:
Openlayers
Version:
7.x-2.x-dev
Component:
OL Layers
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
2 Oct 2012 at 16:59 UTC
Updated:
9 Jan 2013 at 16:20 UTC
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 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 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.