Tuesday, 30 September 2008

pgRouting 1.02 with OpenLayers 2.6


Do the similar steps in pgRouting 1.01 with OpenLayers 2.5 on Ubuntu 7.10 , only change OpenLayers 2.5 to OpenLayers 2.6, change lines according to OpenLayers 2.5 and change following line:

OpenLayers.loadURL("./routing", OpenLayers.Util.getParameterString(result), null, displayRoute);
-->
OpenLayers.loadURL("./routing", result, null, displayRoute);

Note:
- If you use Windows, you can read this page of David: http://www.davidgis.fr/documentation/pgrouting-1.02/

- With OpenLayers 2.7, you can replace OpenLayers.loadURL to OpenLayers.Request.GET.
Ex:
OpenLayers.loadURL("./routing", result, null, displayRoute);
-->
var request = OpenLayers.Request.GET({
url: "./routing",
params: result,
headers: {
"Content-Type": "text/plain"
},
callback: displayRoute
});