Select to view content in your preferred language

legend dijit ans secure mapservices : jsapi 2.3

1305
12
06-01-2011 06:21 AM
Marie-GilSeptfonds
Emerging Contributor
Hello,

My legendDijit works with my non securised mapservices.

But doesn't with my securised mapservices.

When I look the request with firebug the token argument isn't at the fine place in the url.
http://extranet.nimes.fr/website/extranet/AGS/geo_agglo21/php/proxy.php?http://extranet.nimes.fr/arcgis/rest/services/secure/PLU_ZONAGES/MapServer?token=xxxxxxxxxxxxxxxxxx/legend

Normally it should be
http://extranet.nimes.fr/website/extranet/AGS/geo_agglo21/php/proxy.php?http://extranet.nimes.fr/arcgis/rest/services/secure/PLU_ZONAGES/MapServer/legend?token=xxxxxxxxxxxxxxxxxx


Anybody has an idea ?
0 Kudos
12 Replies
AndrewBrown1
Deactivated User
Does anybody else have any suggestions regarding the legend widget?

On our development environment, the server is running SP2 without tokens and the legend appears flawlessly.

On our production environment, which is a separate server, it is running SP2 with tokens and the legend still isn't appearing. We're able to see it under REST, but "No Legend" keeps appearing where the legend is supposed to be.

Anybody have ideas?

We're also running JSAPI 2.4
0 Kudos
BenSayers
Emerging Contributor
Did you ever find out how to correct this problem?
Do I need to change the line in my proxy? I am using:
if(token != null) {
    reqUrl = reqUrl + (reqUrl.indexOf("?") > -1 ? "&" : "?") + "token=" + token;
  }


My legend displays in Chrome, FF and Safari but I get the images missing in IE. I need to try and get this resolved as soon as possible any ideas?

Many thanks,
Ben
0 Kudos
AndrewBrown1
Deactivated User
There might be another thread regarding this issue, as I had trouble figuring out why the legend in IE wasn't working.

Anyhow, I cannot find my fix. I know it had to do something with this piece of code found in my TOC.js file:

if(!dojo.isIE && a.imageData && a.imageData.length > 0) {
    b = "data:image/png;base64," + a.imageData
  }else {
    if(b.indexOf("http") !== 0) {
      b = this.service.url + "/" + this.layer.id + "/images/" + b
    }
  }


It appears it handles IE browsers a little different, so the author had to modify the image connection slightly.

I also remember changing something to "https" and incorporating a method to use the token in the URL string.

Hope this helps,
Andrew
0 Kudos