mark the OpenLayers.loadURL method as deprecated (replaced by OpenLayers.Request.GET). r=erilem,rdewit,ahocevar (closes #3443)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@12206 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Frédéric Junod
2011-08-03 15:55:14 +00:00
parent 0b8a98d9a6
commit f7ccf9ef4e
5 changed files with 21 additions and 9 deletions
+4 -1
View File
@@ -28,7 +28,10 @@
document.getElementById('output').innerHTML = html; document.getElementById('output').innerHTML = html;
} }
function load() { function load() {
OpenLayers.loadURL("kml/lines.kml", "", null, parseData); OpenLayers.Request.GET({
url: "kml/lines.kml",
success: parseData
});
} }
</script> </script>
</head> </head>
+5 -2
View File
@@ -9,7 +9,7 @@
<script src="../lib/OpenLayers.js"></script> <script src="../lib/OpenLayers.js"></script>
<script type="text/javascript"> <script type="text/javascript">
function parseData(req) { function parseData(req) {
format = new OpenLayers.Format.WMSDescribeLayer(); format = new OpenLayers.Format.WMSDescribeLayer();
html = "<br>" html = "<br>"
resp = format.read(req.responseText); resp = format.read(req.responseText);
for(var i = 0; i < resp.length; i++) { for(var i = 0; i < resp.length; i++) {
@@ -22,7 +22,10 @@
document.getElementById('output').innerHTML = html; document.getElementById('output').innerHTML = html;
} }
function load() { function load() {
OpenLayers.loadURL("xml/wmsdescribelayer.xml", "", null, parseData); OpenLayers.Request.GET({
url: "xml/wmsdescribelayer.xml",
success: parseData
});
} }
</script> </script>
</head> </head>
+5 -2
View File
@@ -12,10 +12,13 @@ function init() {
)); ));
map.addControl(new OpenLayers.Control.LayerSwitcher()); map.addControl(new OpenLayers.Control.LayerSwitcher());
OpenLayers.loadURL("tasmania/sld-tasmania.xml", null, null, complete); OpenLayers.Request.GET({
url: "tasmania/sld-tasmania.xml",
success: complete
});
} }
// handler for the loadURL function in the init method // handler for the OpenLayers.Request.GET function in the init method
function complete(req) { function complete(req) {
sld = format.read(req.responseXML || req.responseText); sld = format.read(req.responseXML || req.responseText);
buildStyleChooser(); buildStyleChooser();
+5 -2
View File
@@ -39,8 +39,11 @@
var doc = null; var doc = null;
function init() { function init() {
var url = "xml/features.xml"; OpenLayers.Request.GET({
OpenLayers.loadURL(url, null, null, loadSuccess, loadFailure); url: "xml/features.xml",
success: loadSuccess,
failure: loadFailure
});
} }
function loadSuccess(request) { function loadSuccess(request) {
+2 -2
View File
@@ -46,8 +46,8 @@ OpenLayers.nullHandler = function(request) {
/** /**
* APIFunction: OpenLayers.loadURL * APIFunction: OpenLayers.loadURL
* Background load a document. For more flexibility in using XMLHttpRequest, * Background load a document.
* see the <OpenLayers.Request> methods. * *Deprecated*. Use <OpenLayers.Request.GET> method instead.
* *
* Parameters: * Parameters:
* uri - {String} URI of source doc * uri - {String} URI of source doc