POST
|
Sorry to bring up an old topic but I have encountered an error using the .net printing method from the Developer Summit 2009. I have read through the below forum post where people do mention this issue but as I can see there is no real clear cut answer. http://forums.esri.com/Thread.asp?c=158&f=2396&t=279782 My problem is when I try to go to the layout after printing the map I get an error: "Error: Unable to load .../proxy.ashx? .../MergeAndOutput.ashx status:500." I am not sure if any of the contributors of the other post can help me out with this or if anyone knows what this would relate to. The page itself does seem to be parsing my layers from viewing the source code, it just does not draw up the map - I think it is something to do with the output folder not having the correct permissions but from what I can see all users have write access to it so I am at a bit of a loss as to what the problem could be. Any help would be greatly appreciated as this is an issue that needs urgent attention! Thanks 🙂
... View more
08-19-2011
07:04 AM
|
0
|
4
|
684
|
POST
|
This is something I am looking at as well but am having problems... The idea is that the user enters an address, resulting candidate addresses are populated in a dojox data grid, the user then clicks on an address which then returns whether that address is within the query layer I have specified. My code is below - I have tried to include setting the query geometry inside the row click handler function using the candidate.location details but it seems to throw an issue about the wkid spatial reference being undefined - is there anything glaringly wrong with this? I am trying to populate a div if the map point is within the query layer. //CODE <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" /> <!--The viewport meta tag is used to improve the presentation and behavior of the samples on iOS devices--> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/> <title>RIMS Find</title> <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.4/js/dojo/dijit/themes/claro/claro.css"> <link rel="stylesheet" type="text/css" href="http://rbcarcgis/html/js/dojo/1.6.1/dojox/grid/resources/Grid.css"> <link rel="stylesheet" type="text/css" href="http://rbcarcgis/html/js/dojo/1.6.1/dojox/grid/resources/claroGrid.css"> <style> html, body { height: 100%; width: 100%; margin: 0; padding: 0; } .esriScalebar{ padding: 20px 20px; } #map{ padding:0; } </style> <script type="text/javascript">var djConfig = {parseOnLoad: true};</script> <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.4"></script> <script type="text/javascript" src="https://getfirebug.com/firebug-lite.js"></script> <script type="text/javascript"> dojo.require("dijit.layout.BorderContainer"); dojo.require("dijit.layout.ContentPane"); dojo.require("esri.map"); dojo.require("dojox.grid.DataGrid"); dojo.require("dojo.data.ItemFileReadStore"); dojo.require("dijit.form.Button"); dojo.require("dijit.form.TextBox"); dojo.require("esri.tasks.locator"); dojo.require("esri.tasks.query"); var map; var resizeTimer; var locator, grid, store, geom, symbol, selectedSymbol, graphic, mapPnt; var queryTask, query; function init() { dojo.connect(grid, "onRowClick", onRowClickHandler); var initExtent = new esri.geometry.Extent({"xmin":492116,"ymin":160396,"xmax":511437,"ymax":174034,"spatialReference":{"wkid":27700}}); map = new esri.Map("map",{extent:initExtent}); //Add the topographic layer to the map. View the ArcGIS Online site for services http://arcgisonline/home/search.html?t=content&f=typekeywords:service var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://rbcarcgis/ArcGIS/rest/services/runnymedestreet/MapServer"); map.addLayer(basemap); locator = new esri.tasks.Locator("http://rbcarcgis/ArcGIS/rest/services/locator/GeocodeServer"); dojo.connect(locator, "onAddressToLocationsComplete", showResults); //build query queryTask = new esri.tasks.QueryTask("http://rbcarcgis/ArcGIS/rest/services/rimsdata/MapServer/33"); //build query filter query = new esri.tasks.Query(); query.returnGeometry = false; //resize the map when the browser resizes - view the 'Resizing and repositioning the map' section in //the following help topic for more details http://help.esri.com/EN/webapi/javascript/arcgis/help/jshelp_start.htm#jshelp/inside_guidelines.htm dojo.connect(map, 'onLoad', function(theMap) { dojo.connect(dijit.byId('map'), 'resize', function() { //resize the map if the div is resized clearTimeout(resizeTimer); console.log('resize'); resizeTimer = setTimeout( function() { map.resize(); map.reposition(); }, 500); }); }); } function locate() { map.graphics.clear(); var searchResult = dijit.byId("addressSearch").value; var address = {"Single Line Input": searchResult}; locator.addressToLocations(address,["Ref_ID, Score, Match_addr"]); } function showResults(candidates) { symbol = new esri.symbol.PictureMarkerSymbol('http://rbcarcgis/html/graphics/HOUSE_ICON_VVSMALL.png', 25, 25); selectedSymbol = new esri.symbol.PictureMarkerSymbol('http://rbcarcgis/html/graphics/HOUSE_ICON_VVSMALL.png', 25, 25); //create array of attributes var items = dojo.map(candidates,function(candidate){ geom = new esri.geometry.Point(candidate.location.x, candidate.location.y); var attributes = candidate.attributes; graphic = new esri.Graphic(geom, symbol, attributes); //add a graphic to the map at the geocoded location map.graphics.add(graphic); graphic.hide(); return candidate.attributes; //break out of loop after one candidate with score greater than 80 is found. }); var data = { identifier: "Ref_ID", //This field needs to have unique values label: "Ref_ID", //Name field for display. Not pertinent to a grid but may be used elsewhere. items: items }; //Create data store and bind to grid. store = new dojo.data.ItemFileReadStore({ data:data }); var grid = dijit.byId('grid'); grid.setStore(store); } function onRowClickHandler(evt){ var clickedAddressId = grid.getItem(evt.rowIndex).Ref_ID; var selectedAddress; dojo.forEach(map.graphics.graphics,function(graphic){ if((graphic.attributes) && graphic.attributes.Ref_ID === clickedAddressId){ selectedAddress = graphic; selectedAddress.show(); selectedAddress.setSymbol(selectedSymbol); return; }else{ graphic.hide(); } }); mapPnt = new esri.geometry.Point( {"x": selectedAddress.geometry.x, "y": selectedAddress.geometry.y," spatialReference": {" wkid": 27700 } }); map.centerAndZoom(mapPnt,7); query.geometry = mapPnt; queryTask.execute(query, showQueryResults, error); } function showQueryResults(){ var text = "This property IS within the Green Belt"; dojo.byId("queryres").innerHTML = text; } function error(){ alert("Error!"); } dojo.addOnLoad(init); </script> </head> <body class="claro"> <div dojoType="dijit.form.TextBox" style="width: 25em;" id="addressSearch" placeHolder="Address..."></div> <button dojotype="dijit.form.Button" onclick="locate()"> Locate</button> <div dojotype="dijit.layout.ContentPane" id="resultspane" region="left" style="height: 200px; width: 300px;"> <table dojotype="dojox.grid.DataGrid" data-dojo-id="grid" id="grid" data-dojo-props="rowsPerPage:'5', rowSelector:'20px'"> <thead> <tr> <th field="Score">Match</th> <th field="Match_addr" width="70%">Address</th> </tr> </thead> </table> </div> <div id="map" dojotype="dijit.layout.ContentPane" region="center" style="position: absolute; right: 2px; top: 2px; width: 40%; height: 40%; border:1px solid #000;padding:0;"> </div> <div id="queryres"></div> </body> </html> //CODE
... View more
07-14-2011
01:21 AM
|
0
|
0
|
224
|
POST
|
Heming Brilliant once again - you saved me another day of looking at dojox grid filtering so thanks a lot! 🙂
... View more
07-12-2011
11:57 PM
|
0
|
0
|
499
|
POST
|
Hi Heming Sorry but I have stumbled upon another problem so if you fancy figuring the following out I would appreciate it! 🙂 All of my candidate addresses are coming up in the data grid and I can successfully zoom to each one which is great, but I am trying to limit the number of results that are outputted to the grid using an if statement which is used in the ESRI locator sample (the code snippet below is what I have tried to use). I run it when the array 'items' is built to try and only select those that have a candidate score of 80 or above - my graphics layer is successfully drawing only those candidates that have a score of +80 but the data grid has an error, when using firebug it mentions that it "cannot set property '_RI' of undefined". Digging a bit deeper this variable seems to be set in the dojo.data.ItemFileReadStore:- this._rootItemPropName = "_RI"; // Default Item Id for isItem to attach to every item. This might be something more dojo related but I don't suppose you have any other possible ways of limiting the candidates down by scores or indeed if the above error might be solvable? I appreciate all the help you have given me so far! 🙂 //CODE //create array of attributes var items = dojo.map(candidates,function(candidate){ if (candidate.score > 80){ geom = new esri.geometry.Point(candidate.location.x, candidate.location.y); var attributes = candidate.attributes; var scoreCandidate = candidate.score; var graphic = new esri.Graphic(geom, symbol, attributes); //add a graphic to the map at the geocoded location map.graphics.add(graphic); return candidate.attributes;//break out of loop after one candidate with score greater than 80 is found. } }); //CODE
... View more
07-12-2011
07:44 AM
|
0
|
0
|
499
|
POST
|
Hi Heming Thanks a lot for your help with this, figured out that I need to use the geometry property just as I posted my last reply. Thanks again! 🙂 PS - How can I give you credit for this? I cannot find a "this post answered my question" option anywhere?
... View more
07-11-2011
06:40 AM
|
0
|
0
|
499
|
POST
|
Hi Heming I put an alert in the onrowclick function to write the attributes of graphic just to see what I would get. Before it was just saying undefined but it now successfully shows the Ref_ID value of the row I clicked on which means the code you provided has worked. The problem now is I do not have the X,Y coordinates to use in the attributes to do a zoom to point (I do not have X,Y coordinates available in the candidate fields to use so will have to use the candidate.location values somehow).
... View more
07-11-2011
06:06 AM
|
0
|
0
|
456
|
POST
|
Thanks Heming that was very helpful, I have now managed to get my candidate addresses into the data grid with my desired fields! Using the find sample I would now like to be able to zoom to each individual feature from the grid but am having some problems here. In the original find sample the variable 'graphic' is defined as the result.feature of the find task which has attributes assigned to it already. I have assigned attributes to the 'graphic' variable in my code but it does not seem to work. Is there anything obviously wrong with the below code as to why it might not zoom to each address point? //CODE function locate() { map.graphics.clear(); var searchResult = dijit.byId("addressSearch").value; var address = {"Single Line Input": searchResult}; locator.addressToLocations(address,["Ref_ID, Score, Match_addr"]); } function showResults(candidates) { var symbol = new esri.symbol.SimpleMarkerSymbol(); symbol.setStyle(esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE); symbol.setColor(new dojo.Color([153,0,51,0.75])); //create array of attributes var items = dojo.map(candidates,function(candidate){ var geom = esri.geometry.Point(candidate.location); var attributes = {IDENT:candidate.attributes.Ref_ID}; var graphic = new esri.Graphic(geom, symbol, attributes); //add a graphic to the map at the geocoded location map.graphics.add(graphic); return candidate.attributes; }); var data = { identifier: "Ref_ID", //This field needs to have unique values label: "Ref_ID", //Name field for display. Not pertinent to a grid but may be used elsewhere. items: items }; //Create data store and bind to grid. store = new dojo.data.ItemFileReadStore({ data:data }); var grid = dijit.byId('grid'); grid.setStore(store); } function onRowClickHandler(evt){ var clickedAddressId = grid.getItem(evt.rowIndex).Ref_ID; var selectedAddress; dojo.forEach(map.graphics.graphics,function(graphic){ if((graphic.attributes) && graphic.attributes.IDENT === clickedAddressId){ selectedAddress = graphic; return; } }); map.centreAndZoom(selectedAddress,7); } //FINISH CODE
... View more
07-11-2011
03:25 AM
|
0
|
0
|
456
|
POST
|
Hi Heming Thanks for your response. Yes I was looking at this sample and wondering how it can be implemented for a locator. I was confused as to how you would list the data in the grid particularly with the field headings as they are defined differently.
... View more
07-08-2011
07:11 AM
|
0
|
0
|
456
|
POST
|
Hi Manish, I only recently posted this (around an hour ago) so am still waiting for a response 🙂
... View more
07-08-2011
03:08 AM
|
0
|
0
|
456
|
POST
|
Hi I am working with a locator but would prefer the results to be outputted to a data grid / table for the user to select their desired address (if more than 1 is returned). Cannot seem to find any samples that have implemented this, not too sure if there is anyone out there who has coded something like this? I was thinking of using a dojo data grid (much like the find task sample) but cannot figure out how to pass the candidate results into a grid. Any help? 🙂 Thanks
... View more
07-08-2011
01:11 AM
|
0
|
19
|
1657
|
POST
|
Hi I have implemented a measuring tool which appears to correctly return results when used in both Internet Explorer and Firefox but seems to be slightly out in Google Chrome. I don't suppose anyone else has experienced problems in Chrome at all? Any possible reasons? Thanks
... View more
07-04-2011
12:36 AM
|
0
|
0
|
516
|
POST
|
Hi Just wondering if anyone is using the visible layer option parameter successfully in an identify task to identify just those layers visible on the map? I cannot seem to get it to work and came across the same issue in this thread (http://forums.esri.com/Thread.asp?c=158&f=2396&t=261892) I tried using the following code as mentioned but this didn't help:- identifyParams.layerIds=myDynamicMapServiceLayer.visibleLayers; Any suggestions? Thanks!
... View more
06-09-2011
03:33 AM
|
0
|
1
|
547
|
POST
|
Many thanks for your reply hzhu. I don't think the issue is how the handlers are initialised, it appears to be an issue with setting the content using the 'domnode'. I found this related topic which appears to illustrate the same problem I am having where the divs are not being loaded on a second request... http://forums.esri.com/Thread.asp?c=158&f=2396&t=295163 Unfortunately there does not seem to be a solution in there 😞
... View more
06-06-2011
01:49 AM
|
0
|
0
|
226
|
POST
|
Hi I am trying to implement a toolbar with identify and draw functions initially on it but am having some problems. When I activate the identify tool for the first time it works fine, but if I were to change to the draw tool then back to the identify tool, my infowindow does not pop up, firebug gives me the following message:- TypeError: Cannot call method 'setContent' of undefined{...} There appears to be an issue specifically with how I am setting my content to show but am not too sure why it would initially work, then fail on the next call. Can anyone see any problems with the below code? I am just including how the tool is activated and the identify function so if other bits are required I can post these up. Many thanks! //CODE TO SET THE DIFFERENT TOOLS function turnidTool(ident) { idTool = ident; if (idTool==0) { if (drawHandle!=null) { dojo.disconnect(drawHandle); drawHandle = null; } if (identifyHandle!=null) { dojo.disconnect(identifyHandle); resetFunctionality(); identifyHandle = null; } } if (idTool==1) { if (drawHandle!=null) { dojo.disconnect(drawHandle); drawHandle = null; } if (identifyHandle==null) { identifyHandle = dojo.connect(map, "onClick", doIdentify); } } if (idTool==2) { if (identifyHandle!=null) { dojo.disconnect(identifyHandle); resetFunctionality(); identifyHandle = null; } if (drawHandle==null) { drawHandle = dojo.connect(map, "onClick", doDraw); } } } //CODE FOR THE IDENTIFY TOOL function resetFunctionality() { identifyTask = null; identifyParams = null; symbol = null; } function initFunctionality(map) { if (drawHandle!=null) { dojo.disconnect(drawHandle); drawHandle = null; } identifyTask = new esri.tasks.IdentifyTask("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/BloomfieldHillsMichigan/Parcels/MapServer"); identifyParams = new esri.tasks.IdentifyParameters(); identifyParams.tolerance = 3; identifyParams.returnGeometry = true; identifyParams.layerIds = [0,2]; identifyParams.layerOption = esri.tasks.IdentifyParameters.LAYER_OPTION_ALL; identifyParams.width = map.width; identifyParams.height = map.height; map.infoWindow.resize(400, 250); map.infoWindow.setContent(dijit.byId("tabs").domNode); map.infoWindow.setTitle("Identify Results"); symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]), 2), new dojo.Color([255,255,0,0.25])); } function doIdentify(evt) { if (identifyParams==null) { initFunctionality(map); } map.graphics.clear(); identifyParams.geometry = evt.mapPoint; identifyParams.mapExtent = map.extent; identifyTask.execute(identifyParams, function(idResults) { addToMap(idResults, evt); }); } function addToMap(idResults, evt) { bldgResults = {displayFieldName:null,features:[]}; parcelResults = {displayFieldName:null,features:[]}; for (var i=0, il=idResults.length; i<il; i++) { var idResult = idResults; if (idResult.layerId === 0) { if (!bldgResults.displayFieldName) {bldgResults.displayFieldName = idResult.displayFieldName}; bldgResults.features.push(idResult.feature); } else if (idResult.layerId === 2) { if (!parcelResults.displayFieldName) {parcelResults.displayFieldName = idResult.displayFieldName}; parcelResults.features.push(idResult.feature); } } dijit.byId("bldgTab").setContent(layerTabContent(bldgResults,"bldgResults")); dijit.byId("parcelTab").setContent(layerTabContent(parcelResults,"parcelResults")); map.infoWindow.show(evt.screenPoint, map.getInfoWindowAnchor(evt.screenPoint)); } function layerTabContent(layerResults, layerName) { var content = ""; switch (layerName) { case "bldgResults": if (bldgResults.features.length !== 0){ content = "<b>Building Footprints</b></br>"; content += "<i>Total features returned: " + layerResults.features.length + "</i>"; content += "<table border='1'><tr><th>ID</th><th>Address</th></tr>"; for (var i=0, il=layerResults.features.length; i<il; i++) { content+="<tr><td>"+layerResults.features.attributes['PARCELID']+" <a href='#' onclick='showFeature(" + layerName + ".features[" + i + "]); return false;'>(show)</a></td>"; content+="<td>"+layerResults.features.attributes['Full Site Address']+"</td>"; } content+="</tr></table>"; } break; case "parcelResults": if (parcelResults.features.length !== 0){ content = "<b>Tax Parcels</b></br>"; content += "<i>Total features returned: " + layerResults.features.length + "</i>"; content += "<table border='1'><tr><th>ID</th><th>Year Built</th><th>School District</th><th>Description</th></tr>"; for (var i=0, il=layerResults.features.length; i<il; i++) { content+="<tr><td>"+layerResults.features.attributes['Parcel Identification Number']+" <a href='#' onclick='showFeature(" + layerName + ".features[" + i + "]); return false;'>(show)</a></td>"; content+="<td>"+layerResults.features.attributes['Residential Year Built']+"</td>"; content+="<td>"+layerResults.features.attributes['School District Description']+"</td>"; content+="<td>"+layerResults.features.attributes['Property Description']+"</td>"; } content+="</tr></table>"; } break; } return content; }
... View more
06-03-2011
05:46 AM
|
0
|
3
|
584
|
POST
|
Hi I am wondering if there is an easy way to deactivate/disable the measurement widget? The only way I can see is clicking back onto the icon that was selected but this isn't that obvious for users so I would like to include a button to disable it (if identify / other tools are then activated). There is a destroy method but I cannot seem to activate the tool after this, any ideas?
... View more
05-24-2011
04:25 AM
|
0
|
11
|
8023
|
Title | Kudos | Posted |
---|---|---|
7 | 04-03-2012 02:53 AM | |
7 | 04-03-2012 02:53 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|