[OpenLayers-Users] replacing url in OpenLayers.Protocol.HTTP

Jürgen Dankoweit Juergen.Dankoweit at T-Online.de
Sun Jan 13 21:30:37 PST 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello Gery,

Am 14.01.2013 00:43, schrieb Gery:
> getting closer... because adding OpenLayers.loadURL(myurl, {},
> null, function(response){}); in the handler function sents the url
> to XMLHttpRequest.js (right place), but just immediately another
> url (from the formpanel) is sent to the same place and this covers
> the right one, is there a way to add some timing to the
> openlayers.loadurl function? I understand this function works
> asynchronously (that's why is faster and gets submitted first than
> the second one), is there a way to just overwrite the second one?

You have to destroy the OpenLayers.Protocol.HTTP object and the
reinstatiate it what it is done with the following code snippet:

var proto = new OpenLayers.Protocol.HTTP({
  autoLoad: {
  url: myurl
  format: new OpenLayers.Format.GeoJSON()
});


now call GeoExt.form.Formpanel with the new proto object:
new GeoExt.form.FormPanel({
 ...
  protocol: proto,
 ...
});

Hope this helps.

Best regards

Juergen


- -- 
Meine stets unfertige Homepage: www.dankoweit.de
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iQEcBAEBAgAGBQJQ85f9AAoJEJ3ceAfUXknyb8IH/3O20S8xdtR0r4d9hCt3Dp7O
GuXvzAihjCXW/xZbkE0cskIopEvd0NI9dklTHH6WzfRibKkvpZ4l/aUxs+GM96Sp
7icAUDsth/9FmVUBwrUmwR5iqvw+QRcj2Z1Hckj0h9QrNVhHnKg+GjgKN6ebr5ud
9jEVQA4JoxSE2sY0im0N+IZhmwJPvXTvp7q8OFgx7AkoHcaFnnDCbJRSErxwfkcS
5aNRvaf4Uq7GYupBo3X79zgsUS1GbqscBxbOmubxcAwxgqRN9pBOfow6exC1A3rc
1dZARi5RfBmZjyhCSC1fzr2t3iFfkpy/Zot+8LlsQh4Do2wmQELu9WBBS0g+D8A=
=U+Fo
-----END PGP SIGNATURE-----


More information about the Users mailing list