阅读:2584回复:0
使用ArcXML在HTML Viewer中动态添加数据层'); if (isSecond) document.write(''); } if (parent.MapFrame.canLoad) { // Load MapService. . . requires aimsGeneric.js document.write(''); } 改成: if (parent.MapFrame.allowOptions) { // Options. . . requiers aimsOptions.js... allowOptions is set to true in this file document.write(''); if (isSecond) document.write(''); } if (parent.MapFrame.addDynLayer) { document.write(''); if (isSecond) document.write(''); } if (parent.MapFrame.canLoad) { // Load MapService. . . requires aimsGeneric.js document.write(''); } 6.为了添加动态图层,请求新的地图图片,进行如下编辑: A.在文本编辑器中打开aimsClick.js.在clickFunction()函数中将下列代码: function clickFunction (toolName) { if (hasLayer("measureBox")) hideLayer("measureBox"); switch(toolName) { // Zooming functions case "zoomin": 改成: function clickFunction (toolName) { if (hasLayer("measureBox")) hideLayer("measureBox"); switch(toolName) { // Zooming functions case "CustomAXL": if (aimsCustomPresent){ aimsCustomPresent=false } else { aimsCustomPresent=true; } parent.MapFrame.sendMapXML(); break; case "zoomin": 当aimsCustomPresent为true时,aimsXML.js文件中writeXML()函数中下面这行代码会调用 aimsCustom.js文件中的addCustomToMap1()函数. if (aimsCustomPresent) theString += addCustomToMap1(); 注:每次有更新地图图片的请求时,writeXML() 都会被调用. 7.在文本编辑器中打开aimsCustom.js,作下列改动: A.将这行代码"aimsCustomPresent=true;"改成aimsCustomPresent=false; B.将addCustomToMap1() 函数中的代码段: function addCustomToMap1(){ var customString = ""; /* customString += ' customString += ''; customString += 'n */ return customString; } 改成: function addCustomToMap1(){ var customString = ""; customString += ' customString += ' customString += ' customString += ' id="2">n'; customString += ' workspace="shp_ws-1" />n'; customString += ' customString += ' customString += ' customString += ' return customString; } 8.保存所有的文件 9.在浏览器中打开WEB站点.注:会弹出消息框,显示客户端的ArcXML(REQUEST)已经发送到服务 器,且收到服务器返回的ArcXML()(RESPONSE). 10.点击工具栏中的扳手图标.我们定制的ArcXML字符串就添加到了GET_IMAGE请求中发送到 ArcIMS服务器.你可以看到一个REQUEST(包含aimsCustom.js里addCustomToMap1()中的字符串 )和一个RESPONSE(包含输出的图片的位置)
|
|||||||||