Buffering Geometries just reloads my page.

486
2
04-10-2012 04:05 PM
StevenGriffith
New Contributor III
I'm sending a geometry off to a GeometryService to be buffered, and instead of buffering the geometry, the .buffer() call does not call the buffer service, but instead reloads my web page with some odd url parameters: "localhost\testmap?bufferradius=500&permitsearch=Permits&parcels=Parcels+%28Geom%29". Neither the callback nor the errorback functions are called.

What's interesting is that if I step into the dojo code for the .buffer() call, the HTTP call to the buffer service does happen, my callback function is called, but when the deferred calls unwind from the call stack, the same reload of my web page with the odd url parameters happens.

Note that this is code that had been working perfectly for some time (in fact, it was working this morning). Here's the relevant code, even though it has not changed in weeks.

        // buffer and unify geometries on selection layer
        params = new esri.tasks.BufferParameters();
        params.distances = []
        params.distances.push(graphicbuffer.value());
        params.bufferSpatialReference = map.spatialReference;
        params.outSpatialReference = map.spatialReference;
        params.unit = graphicbuffer.unit();
        params.unionResults = true;

        // list geometries to buffer
        params.geometries = [];
        for (g = 0; g < selectionObject.layer.graphics.length; g++) {
             // get the graphic's geometry
            geom = selectionObject.layer.graphics.geometry;
            params.geometries.push(geom);
        };

        geometryService.buffer(params, 
        function (bufferedgeometries) {
            // replace geometrys with buffered versions
            selectionObject.layer.clear();
            for (g = 0; g < bufferedgeometries.length; g++) {
                geom = new esri.Graphic(bufferedgeometries, selectionObject.drawtoolbar.fillSymbol);
                selectionObject.layer.add(geom);
            };
        }, function(err){
            ErrorHandler(err, "dataquery: " + where);
        });
0 Kudos
2 Replies
StevenGriffith
New Contributor III
Any ideas???
0 Kudos
derekswingley1
Frequent Contributor
How is the buffer initiated? What does your HTML markup look like? Are you using a <form> element anywhere (I ask specifically about this because submitting a form will trigger a page reload)?
0 Kudos