[OpenLayers-Users] ArgParser not working

bwoodall bwoodall at bwoodall.org
Thu May 1 20:52:40 EDT 2008


On Thu, 2008-05-01 at 17:09 -0700, chris1211 wrote:
> I have tryed to add the ArgParser control and also tryed the permalink
> control and none of them will work can some one pleeeeeeeeae help me!!!!!
> I've been trying to figure this out for the last four days!!!
> 
> 
[.snip.]

Howdy Chris,

First, you might want to strip the page down to only what is needed

Second, I'm not sure if you want to parse non-OL args, but if you do you
can do so by using O.U.getParameters in your init()

function init() {
.
.
.
var arg_pairs = new OpenLayers.Util.getParameters();
/*
 * arg_pairs is an JS object of Key/Value pairs
 */

  if (arg_pairs.zip) {
      zip = parseInt(arg_pairs.zip);
      var uri = "http://someplace/cgi-bin/ConvertZip2LonLat.py?zipcode="+zip;
      OpenLayers.loadURL(uri, '', this, setZipCode);
  } else {
.
.
.


...........Bill,




More information about the Users mailing list