POST
|
No, I'm not sure where to find that in the Developer Tools. Is that on the Network tab? This is what I saw there: http://[myServer]/arcgis/rest/services/[MapServiceName]/MapServer/0/query?where=PID_NUM%3D%2745214.9222%27&text=&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&resultOffset=&resultRecordCount=&f=html If I return the JSON instead of HTML from the Rest Query tool, it DOES tell me it failed to execute the query. If I tell it to Return Count Only, I get a result of { "count": 1 } which was why I thought it was working. That makes no sense, because this feature layer is used for an existing web app and is functioning fine there (see the original syntax in my original post).
... View more
07-31-2017
11:05 AM
|
0
|
8
|
2633
|
POST
|
Thanks for that. I didn't see that example before. I implemented it and it did fail to execute the query with that "promise rejected" code. So I must have some syntax wrong. I verified that the query works when I go directly to the map service rest endpoint Query tool.
... View more
07-31-2017
10:40 AM
|
0
|
10
|
2633
|
POST
|
It does appear that I'm passing in the URL parameter value, but while I am not getting any errors from the queryParcelsTask call, it's also not going into the zoomparcel function. So I'm guessing that no, it's not returning results. I verified that I have the field name right that I'm passing into query.where. I'm using IE F12 Developer Tools to debug, but am struggling to figure out how to put a watch on queryParcelsTask results to see if I can get a "count" of results from that. Will keep plugging away... thank you.
... View more
07-31-2017
09:30 AM
|
0
|
12
|
2633
|
POST
|
It seems I wasn't getting the parcel number from the URL. I've since fixed that, however still not getting the map to zoom into the feature and highlight it. Will keep fighting it, but am certainly appreciative of any suggestions. var urlParams = urlUtils.urlToObject(document.URL); if (urlParams.query){ var urlParcelIDParam = parseFloat(urlParams.query.PID); } selectParcel(urlParcelIDParam); function selectParcel(urlParcelIDParam) { if (urlParcelIDParam) { var queryParcelsTask = new QueryTask({ url: "http://[myServer]/arcgis/rest/services/[mapServiceName]/MapServer/0" }); var query = new Query(); query.where = "PID_NUM = '" + urlParcelIDParam + "'"; queryParcelsTask.execute(query).then(zoomparcel); } } function zoomparcel(result) { view.goTo(result.features); } });
... View more
07-31-2017
08:40 AM
|
0
|
14
|
2633
|
POST
|
Thank you Ken. I did try to implement the suggested fix from that thread (see green text below), but something still isn't right. I get a blank window, no basemap, no widgets, suggesting the JS isn't right. Any obvious thing I'm missing here that you can see? var parcelid = document.getElementById("<%= hfParcel.ClientID%>").value;// prompt("Give me input"); selectParcel(parcelid); function selectParcel(parcelid) { if (parcelid) { var queryParcelsTask = new QueryTask({ url: "http://[myServer]/arcgis/rest/services/[mapServiceName]/MapServer/0" }); var query = new Query(); query.where = "PID_NUM = '" + parcelid + "'"; queryParcelsTask.execute(query).then(zoomparcel); } } function zoomparcel(result) { var AOI = result.features; view.goTo(AOI); }
... View more
07-31-2017
07:49 AM
|
0
|
0
|
2633
|
POST
|
Need a little guidance for an ArcGIS for JavaScript newbie. I have a custom set of layers from a MapImageLayer displaying over an ESRI basemap. I'm trying to take a parameter from the URL (in this case a unique parcel number) and find it in a layer (in this case Parcels layer), highlight that feature, zoom to it and center the map on it. A colleague did that in JavaScript 3.16, however I'm using JS 4.4 and the methods and objects have changed a bit. Below is a subset of my code that was pulled from the JS 3.16 example and I've been trying to massage it into something useful in JS 4.4. The object graphicsUtils doesn't appear to exist in 4.4, the query results in a blank map screen, the method setSelectionSymbol breaks my code... Can anyone give me some sample code I can use to fix this to result in my goals to find the parcel, zoom to, center and highlight it? Thank you. //Parcel Selection Layer parcels = new FeatureLayer("http://[myServer]/arcgis/rest/services/[mapservicename]/MapServer/0", { outFields: ["*"], //Needs to be Selection Mode, on demand results in odd parcel shapes mode: FeatureLayer.MODE_SELECTION }); parcels.setSelectionSymbol(sfs); //sfs = simplefillsymbol map.addLayers([parcels]); var parcelid = document.getElementById("<%= hfParcel.ClientID%>").value;// prompt("Give me input"); selectParcel(parcelid); //select parcel from the feature layer by creating a query to look for the input parcel id function selectParcel(parcelid) { if (parcelid) { var query = new Query(); query.where = "PID_NUM = '" + parcelid + "'"; var deferred = parcels.selectFeatures(query, FeatureLayer.SELECTION_NEW, function (selection) { var center = graphicsUtils.graphicsExtent(selection).getCenter(); var extent = esri.graphicsExtent(selection); var extHandler = map.on("extent-change", function () { extHandler.remove(); //zoom to the center then display the popup map.infoWindow.setFeatures(selection); }); map.setExtent(extent.getExtent().expand(2)); map.centerAt(center); }); } }
... View more
07-30-2017
09:25 PM
|
0
|
17
|
9551
|
POST
|
I have a Web App Builder URL that is passed a parameter to zoom into a parcel polygon. My application, when passing that parameter does a great job at selecting that polygon, however a pop-up with its related information appears. I need to embed this application within another web page/app, making it fit a small space so the pop-up isn't necessary and takes up too much of that space. An example of my URL is below. http:// myorganization.maps.arcgis.com/apps/webappviewer/index.html?id=20a3ac29bb134172a8e13dc73db879b5&mobileBreakPoint=300&query=parcels,pid_num,55203.0405 This said, I need help with two things: How do I turn off the pop-ups and still get the URL to zoom into and select the parcel polygon? How can I embed that URL in an ASPX webpage and pass the parcel parameter based upon an established session variable containing it's value (I've been toying with JavaScript)? I've tried using a div and an iframe tag, but I can't seem to get the div to properly display my URL and can't get any javascript to work right to pick up the session variable or shut off the pop-up. Thanks for any ideas!
... View more
06-22-2017
05:07 PM
|
0
|
0
|
438
|
POST
|
I guess I don't know how a view would help here. We have a spatial database feature class with a field for parcel numbers, nvarchar(255). We have a non-spatial table with a varchar(15) field for parcel numbers. Both are on different SQL2008R2 servers. In ArcMap 10.3.1/10.4 we have the feature class as a layer. We join that layer to the table on the respective parcel number fields using ArcMap's Join Data UI (found by right-clicking on the layer). There's no conversion going on.
... View more
11-04-2016
11:42 AM
|
0
|
1
|
417
|
POST
|
Hi Vince, I've been looking at this issue with Matt, too. Do you have a better suggestion to join the two tables? He's using a non-spatial database connection to join to an SDE connection (there's no ODBC set up on the computer). I tried in 10.4 to connect two *.sde connections to this same data and the join doesn't result in any match at all. The spatial database is non-versioned, the field is nvarchar(255). We don't have the authority to make any changes here. The non-spatial is varchar(15). The values that aren't matching up have been verified in both places as being 10 characters exactly.
... View more
11-04-2016
07:50 AM
|
0
|
3
|
417
|
POST
|
Steve, apparently the computer that doesn't work doesn't see the "via x-ua-compatible" meta tag. So that may be the key, especially given Robert's suggestions. So I need to figure out why not. This is from a computer that works: This is from a computer that doesn't display the basemap on the same network:
... View more
10-06-2016
09:36 AM
|
0
|
1
|
809
|
POST
|
Sorry, I overlooked that detail. The machine is running over a true inTERnet URL, however it IS connected to our internal network. That might be a test, to see if it works when connected to a network outside of the office. Good thought!
... View more
10-06-2016
09:19 AM
|
0
|
0
|
809
|
POST
|
Thanks Robert for the response! It looks like we have that in the html file: <!DOCTYPE html> <html> <head> <meta http-equiv="X-UA-Compatible" content="IE=Edge"> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no"> <title>Average Daily Traffic</title> <!-- Include ArcGIS stylesheets --> <link rel="stylesheet" href="http://js.arcgis.com/4.0/esri/css/main.css"> <!-- Include jquery --> <script type="text/javascript" src="../jquery/jquery-1.11.3.min.js"></script> <script type="text/javascript" src="../jquery/jquery-ui-1.10.4/ui/jquery-ui.js"></script> <!-- Include ArcGIS API --> <script src="https://js.arcgis.com/4.0/"></script> <!-- Include ADT JavaScript--> <script type="text/javascript" src="ADT.js"></script> <!-- Include ADT stylesheets --> <link rel="stylesheet" href="ADT.css"> </head> The JS file is included and here's a snippet of the code: function ( Map, MapView, Extent, SpatialReference, FeatureLayer, PopupTemplate, Legend, Home, on, dom, domAttr, domConstruct ) { var map = new Map({ basemap: "streets" }); var view = new MapView({ container: "viewDiv", map: map, center: [-117.427677, 47.644390], zoom: 9, // padding: { // right: 200 // }, popup: { // dockEnabled: true, dockOptions: { breakpoint: false, // to prevent automatic docking when screen gets small position: "bottom-left", } } }); view.constraints = { minScale: 2000000, // User cannot zoom out beyond a scale of 1:2,000,000 maxScale: 0, // User can overzoom tiles rotationEnabled: false // Disables map rotation }; Would you concur, or did I overlook something?
... View more
10-06-2016
08:07 AM
|
0
|
6
|
809
|
POST
|
I have one computer that will not display an ESRI vector base map: var map = new Map({ basemap: "streets-vector" }); It works on all other computers I have tried, just one computer for all users won't display this base map. The "topo" and "streets" base maps work just fine. Any ideas? I'm guessing it's a settings issue, but I am simply helping debug this app, I am not very familiar with ArcGIS for JavaScript API. I haven't found anything different in Compatibility View on a computer that works and this one that doesn't. Same with the Internet Options settings. The computer is on Windows 8 and the one I'm testing against that does work is Windows 10. Both IE11. Firefox and Chrome display the basemap just fine. I welcome any ideas on what to look for, either in IE settings or in code.
... View more
10-05-2016
05:12 PM
|
0
|
8
|
1645
|
POST
|
Thank you, Emily! I didn't realize that our externally connected GPS fell under that umbrella. I sent in a request to test beta Collector with the higher accuracy for GNSS.
... View more
04-20-2016
07:36 AM
|
0
|
0
|
906
|
Title | Kudos | Posted |
---|---|---|
3 | 05-29-2018 01:54 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|