1

Currently, i'm using the addProxyRule to set up the proxy to be used when calling arcgis. I'm then taking that result and generating a url to take the user to a different part of our site pertaining to where they click on the map. What is happening though is that in Firefox, the back button does not take the user back to the previous page, it takes the user back 2 pages instead and doesn't seem to cache the previous page for the user to return to.

I've looked at the document.referrer in the console and it has the correct referring link so i'm not sure what is happening here.

the jquery code is below and i'm providing a link to the site (http://geospatial.com, if you click on the map on the page, it is calling the code below to direct the user to the country they select) where this issue is happening in case it helps solve this mystery.

function init() {

// setup proxy
var proxyUrl = "/desktopmodules/evg/evgstore/proxy.ashx";
esri.addProxyRule({ urlPrefix: "gis.geospatial.com", proxyUrl: proxyUrl });

$(document).ready(function () {



    if ($("#evg-home-map").length > 0) {
        // draw map

        map = new esri.Map("evg-home-map", {
            basemap: "gray",
            wrapAround180: true,
            nav: false,
            logo: false,
            slider: true,
            minZoom: 2,
            center: [20, 50]
        });


        dojo.connect(map, "onClick", mapClicked);
        dojo.connect(map, "onMouseOver", mapHover);
    }

});


function mapClicked(e) {
    var pt = e.mapPoint;

    // define query
    var query = new esri.tasks.Query();
    query.returnGeometry = true;
    query.geometry = pt;
    query.outFields = ["EVC_3_LETTER, C_NAME_CAPS"];




    // execute task
    var queryTask = new esri.tasks.QueryTask(ArcGisCountry);
    queryTask.execute(query, function (fs) {

        //esri.hide(loading);

        //// assign featureSet array to a single variable.
        if (fs.features.length > 0) {
            var url = "/products/countries/";
            var countryAbbr = fs.features[0].attributes["EVC_3_LETTER"];
            var countryName = fs.features[0].attributes["C_NAME_CAPS"];

                url = url + countryName.slugify("-") + "-" + countryAbbr.slugify("-") + "/";
                window.location.href = url;
        }



    }, function (errorObject) {

        alert("MapClicked Error: " + errorObject);
    });
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.