Friday, 13 September 2013

Creating new instance of esri map

Creating new instance of esri map

I have an esri arc gis map. I create my map div, load that data to the map
via an ajax call. On a hyper link the jquery dialog is opened and the map
and data is loaded in there. Works great until I close and open a new
link. The same map appears and nothing changes.
V is the line number passed in from the hyper link. On each click of a new
hyper link V is changing but the map data isnt. In my dialog on the close
event i reloaded the whole page while this worked it was inefficient. The
best solution i've seen is using the map.destroy method but any time I put
that in the code it destroys the map before it even opens. Let me know if
you need anything else.
Thanks
Here is the code:
function loadData(v)
{
var varId = v;
var regType = 1;//MSA
var d =
{
varId: varId,
regionType: regType,
};
$("#loading").show();
$.ajax({
type: "GET",
url: WebRoot + "ws/GIS.asmx/CensusData",
data: d,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
fipsData = data.d;
openBox(v, d);
init(varId);
initUI();
addFeatureLayers();
$("#loading").hide();
} //ends success function
}); //ends ajax call
}; //ends message

No comments:

Post a Comment