POST
|
Hi, I want to change the theme color pragmatically on load for foldable theme of WAB. How can it be done? Regards.
... View more
08-07-2020
04:23 AM
|
0
|
0
|
251
|
POST
|
Hi, I am trying to show the column chart on click of a map on info template window, which is working fine for positive values. But whereas for negative values, the x-axis doesn't move to '0' of Y-axis. Please find below image X-Axis remains at bottom every time, even when all the 3 column values are negative. Please find below image Here the X-axis line shall be on top. Can anyone help me!! Regards,
... View more
06-18-2020
07:24 AM
|
0
|
0
|
346
|
POST
|
Hi, I am not able to show column chart in pop-up window of map click. I am not getting any error message also in console. <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"> <title>Info Window with Chart</title> <link rel="stylesheet" href="https://js.arcgis.com/3.32/dijit/themes/claro/claro.css"> <link rel="stylesheet" href="https://js.arcgis.com/3.32/esri/css/esri.css"> <style> html, body, #map { height: 100%; width: 100%; margin: 0; padding: 0; } .chart { width:200px; height:200px; padding:0px !important; } </style> <script src="https://js.arcgis.com/3.32/"></script> <script> var map; // Try other themes: Julie, CubanShirts, PrimaryColors, Charged, BlueDusk, Bahamation, Harmony, Shrooms var theme = "Wetland"; require([ "esri/map", "esri/layers/FeatureLayer", "esri/dijit/InfoWindow", "esri/InfoTemplate", "esri/symbols/SimpleFillSymbol", "esri/renderers/SimpleRenderer", "dijit/layout/ContentPane", "dijit/layout/TabContainer", "dojox/charting/Chart2D", "dojox/charting/plot2d/Columns", "dojox/charting/action2d/Highlight", "dojox/charting/action2d/MoveSlice", "dojox/charting/action2d/Tooltip", "dojox/charting/themes/MiamiNice", "dojo/dom-construct", "dojo/dom-class", "dojo/number", "dojo/domReady!" ], function( Map, FeatureLayer, InfoWindow, InfoTemplate, SimpleFillSymbol, SimpleRenderer, ContentPane, TabContainer, Chart2D, Columns, Highlight, MoveSlice, Tooltip, MiamiNice, domConstruct, domClass, number, parser ) { // Use the info window instead of the popup. var infoWindow = new InfoWindow(null, domConstruct.create("div")); infoWindow.startup(); map = new Map("map", { basemap: "streets", center: [-113.405, 43.521], infoWindow: infoWindow, zoom: 6 }); map.infoWindow.resize(275, 275); var template = new esri.InfoTemplate(); // Flag icons are from http://twitter.com/thefella, released under creative commons. template.setTitle("<b><img src='flags/${STATE_ABBR}.png'> ${STATE_NAME}</b>"); template.setContent(getWindowContent); var statesLayer = new FeatureLayer("https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/5", { mode: FeatureLayer.MODE_ONDEMAND, infoTemplate: template, outFields: ["*"] }); var symbol = new SimpleFillSymbol(); statesLayer.setRenderer(new SimpleRenderer(symbol)); map.addLayer(statesLayer); function getWindowContent(graphic) { // Make a tab container. var tc = new TabContainer({ style: "width:100%;height:100%;" }, domConstruct.create("div")); // Display attribute information. var cp1 = new ContentPane({ title: "Details", content: "<a target='_blank' href='https://en.wikipedia.org/wiki/" + graphic.attributes.STATE_NAME + "'>Wikipedia Entry</a><br><br>Median Age: " + graphic.attributes.MED_AGE + "<br>Median Age (Male): " + graphic.attributes.MED_AGE_M + "<br>Median Age (Female): " + graphic.attributes.MED_AGE_F }); // Display a dojo pie chart for the male/female percentage. var cp2 = new ContentPane({ title: "Pie Chart" }); tc.addChild(cp1); tc.addChild(cp2); // Create the chart that will display in the second tab. var c = domConstruct.create("div", { id: "demoChart" }, domConstruct.create("div")); var chart = new Chart2D(c); domClass.add(chart, "chart"); // Apply a color theme to the chart. chart.setTheme(MiamiNice); chart.addPlot("default", { type: "Columns", markers: true, gap: 5 }); tc.watch("selectedChildWidget", function(name, oldVal, newVal){ if ( newVal.title === "Columns" ) { chart.resize(180,180); } }); // Calculate percent male/female. var total = graphic.attributes.POP2000; var male = number.round(graphic.attributes.MALES / total * 100, 2); var female = number.round(graphic.attributes.FEMALES / total * 100, 2); chart.addAxis("x"); chart.addAxis("y", { vertical: true, fixLower: "major", fixUpper: "major" }); chart.addSeries("PopulationSplit", [{ x:0, y: male, tooltip: male, text: "Male" }, { x:0, y: female, tooltip: female, text: "Female" }]); //highlight the chart and display tooltips when you mouse over a slice. new Highlight(chart, "default"); new Tooltip(chart, "default"); new MoveSlice(chart, "default"); cp2.set("content", chart.node); return tc.domNode; } }); </script> </head> <body class="claro"> <div id="map"></div> </body> </html> Regards,
... View more
06-05-2020
11:35 AM
|
0
|
2
|
450
|
POST
|
Hi, I want to add maximize button in infowindow, where on maximize the content also get larger like charts, diagrams etc. Please find below image for example. when i maximize the size of the pie chart shall also increase. Regards
... View more
06-05-2020
09:56 AM
|
0
|
1
|
371
|
POST
|
Hi, I am trying to over-ride few methods of LabelLayer.js file, there are 2 class "esri/layers/labelLayerUtils/DynamicLabelClass & "esri/layers/labelLayerUtils/StaticLabelClass" which has been called from that js file. It is working fine for below code: require(["esri/layers/labelLayerUtils/DynamicLabelClass"],function(dc){ if( typeof esri.layers.labelLayerUtils.DynamicLabelClass.prototype._findPlace == 'function' ) { esri.layers.labelLayerUtils.DynamicLabelClass.prototype._findPlace = function(h, b, a, c, k, d, e){ When i tried to over-ride method for StaticLabelClass, its throwing "Prototype is undefined" require(["esri/layers/labelLayerUtils/StaticLabelClass"],function(sc){ if(typeof esri.layers.labelLayerUtils.StaticLabel.prototype._findPlace='function'){ esri.layers.labelLayerUtils.StaticLabel.prototype._findPlace = function(b, a, c, k, d, e, f){ During debug, for labelLayerUtils, only DynamicLabelClass shown. PFB image whereas in JS API, I can see there are 2 files: Please help me how to get "StaticLabelClass" method to over-ride? Regards, Shaikh
... View more
05-27-2020
08:00 AM
|
0
|
0
|
279
|
POST
|
Hi, I am having "Location" parameter where 'x' & 'y' value has to pass in SOE to process the request.Below is the C# code to access the SOE request. // Create a request using a URL that can receive a post. WebRequest request = WebRequest.Create("https://myServer.com:6443/arcgis/rest/services/ITDService/MapServer/exts/DistanceSOE/SpatialQuery"); // Set the Method property of the request to POST. request.Method = "POST"; // Create POST data and convert it to a byte array. string postData = "{\"Location\": {\"x\": 84.44902820440936,\"y\": 21.300696836245145}}"; byte[] byteArray = Encoding.UTF8.GetBytes(postData); // Set the ContentType property of the WebRequest. request.ContentType = "application/x-www-form-urlencoded"; // Set the ContentLength property of the WebRequest. request.ContentLength = byteArray.Length; // Get the request stream. Stream dataStream = request.GetRequestStream(); // Write the data to the request stream. dataStream.Write(byteArray, 0, byteArray.Length); // Close the Stream object. dataStream.Close(); // Get the response. WebResponse response = request.GetResponse(); // Display the status. Console.WriteLine(((HttpWebResponse)response).StatusDescription); // Get the stream containing content returned by the server. // The using block ensures the stream is automatically closed. using (dataStream = response.GetResponseStream()) { // Open the stream using a StreamReader for easy access. StreamReader reader = new StreamReader(dataStream); // Read the content. string responseFromServer = reader.ReadToEnd(); // Display the content. Console.WriteLine(responseFromServer); } It is going to SOE but could not able to read the "Location" Parameter and its values. PFB image for the same. Can anyone let know, how parameters need to be send?
... View more
09-20-2019
10:01 AM
|
0
|
2
|
2807
|
POST
|
Hi Gill, Its depends on how your points closed to each other, I did it based on the visualization. Please refer the below link https://developers.arcgis.com/javascript/3/jsapi/featurelayer-amd.html#setfeaturereduction Regards Shaikh
... View more
07-02-2019
04:43 AM
|
1
|
1
|
313
|
POST
|
Hi, I am trying to print map with custom template by publishing services in AGS, For small area, print output works fine. whereas for larger area print output is not coming. Even for default print the same error persists. Please find below error message in console: I am using proxy (.NET) to handle the large request/response size. Form AGS logs there is no error, PFB image for the same Below is the JS code in WAB: Regards, Shaikh
... View more
07-02-2019
04:36 AM
|
0
|
0
|
288
|
POST
|
Hi Robert, Is there any other way around to get that kind of functionality, I want to implement in one of the widget of WAB (2.6). I have attached .gif file which i found in one of the ESRI link. How can i achieve the above functionality?
... View more
02-11-2019
09:28 PM
|
0
|
1
|
545
|
POST
|
Hi, I want to open esri popup template from popup template on click of table data, Please find below image: I want to show some charts related to feature layer, on click of table data as shown below: Regards, Shaikh Rizuan
... View more
02-11-2019
05:12 AM
|
0
|
3
|
671
|
POST
|
Hi, I am trying the plot the arrow symbols along the direction of the line, but its not working properly. PFB image one arrow symbols shows correct direction but other do not, PFB code for getting the angle: //Create Line from two points var line = new Polyline(); line.addPath([pt1,pt]); var lineGraphics = map.graphics.add(new Graphic(line,lineSymbol )); lineGraphics.setGeometry(line); //Get mid point of a line var midPoint = lineGraphics._extent.getCenter(); //Get angle for the line var angle = this._getAngle(lineGraphics.geometry.paths[0][0],lineGraphics.geometry.paths[0][1]); var picSymbol= new PictureMarkerSymbol(); picSymbol.setUrl("css/images/filled-arrow.png"); picSymbol.setHeight(12); picSymbol.setWidth(12) picSymbol.setAngle(angle); map.graphics.add(new Graphic(midPoint,picSymbol)); ///////////////////////////////////////////////////////// _getAngle:function(p1,p2){ var srtPnt = p2[1]-p1[1]; var endPnt= p2[0]-p1[0]; var angle =((180/Math.PI)* Math.atan2(srtPnt,endPnt)); return angle-180; } What changes need to be done to get proper angle? Regards, Shaikh
... View more
10-27-2018
04:33 AM
|
0
|
0
|
653
|
POST
|
Hi, I have to get the distance from various points plotted on the map from the user point on the page load. When i am keeping all the promise in an array, and assigning to dojo/promise/all, it throws an error "Unable to complete operation." below is the code: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"> <title>Create Map and add a dynamic layer</title> <link rel="stylesheet" href="https://js.arcgis.com/3.24/esri/css/esri.css"/> <style> html, body, #mapDiv{ padding: 0; margin: 0; height: 100%; } </style> <script src="https://js.arcgis.com/3.24/"></script> <script> var map; var fromPoint; var task; var toPoints=[]; require([ "dojo/_base/lang", "esri/map", "esri/layers/ArcGISDynamicMapServiceLayer", "esri/tasks/GeometryService", "esri/layers/GraphicsLayer", "esri/symbols/SimpleFillSymbol", "esri/symbols/SimpleLineSymbol", "esri/Color", "esri/symbols/SimpleMarkerSymbol", "esri/geometry/Point", "esri/SpatialReference", "esri/graphic", "esri/tasks/DistanceParameters", "dojo/_base/array", "dojo/promise/all" ], function ( lang, Map, ArcGISDynamicMapServiceLayer, GeometryService,GraphicsLayer,SimpleFillSymbol,SimpleLineSymbol,Color,SimpleMarkerSymbol,Point,SpatialReference,Graphic,DistanceParameters,array,all) { map = new Map("mapDiv", { sliderOrientation : "horizontal" }); //Takes a URL to a non cached map service. var dynamicMapServiceLayer = new ArcGISDynamicMapServiceLayer("https://servername:6443/arcgis/rest/services/IndiaMapMMI/MapServer", { }); map.addLayer(dynamicMapServiceLayer); var geometryService = new esri.tasks.GeometryService("https://utility.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"); var frmGraphicsLayer = new GraphicsLayer(); var toGraphicsLayer = new GraphicsLayer(); var circleSymbF = new SimpleFillSymbol( SimpleFillSymbol.STYLE_SOLID, new SimpleLineSymbol( SimpleLineSymbol.STYLE_SHORTDASHDOTDOT, new Color([255, 0, 0]),2), new Color([255, 255, 0, 0.25]) ); var symbol2 = new SimpleMarkerSymbol( SimpleMarkerSymbol.STYLE_DIAMOND, 15, new SimpleLineSymbol( SimpleLineSymbol.STYLE_NULL, new Color([0, 0, 0, 0.9]), 1 ), new Color([255, 0, 0, 1]) ); var symbol1 = new SimpleMarkerSymbol( SimpleMarkerSymbol.STYLE_DIAMOND, 15, new SimpleLineSymbol( SimpleLineSymbol.STYLE_NULL, new Color([0, 0, 0, 0.9]), 1 ), new Color([0, 255, 0, 1]) ); var symbol3 = new SimpleMarkerSymbol( SimpleMarkerSymbol.STYLE_DIAMOND, 15, new SimpleLineSymbol( SimpleLineSymbol.STYLE_NULL, new Color([0, 0, 0, 0.9]), 1 ), new Color([0, 0, 255, 1]) ); myObj = {"features":[ { "attributes": { "CaseID": 001, "Latitude": 28.634962, "Longitude": 77.034805, "SerialNo":7557, "Status":"FromPoint" } }, { "attributes": { "CaseID": 002, "Latitude": 28.612663, "Longitude": 77.053215, "SerialNo":7557, "Status":"Pending" } }, { "attributes": { "CaseID": 003, "Latitude": 28.596744, "Longitude": 77.075981, "SerialNo":7557, "Status":"Completed" } },{ "attributes": { "CaseID": 004, "Latitude": 28.615241, "Longitude": 77.061687, "SerialNo":7557, "Status":"Completed" } } ] }; var promises = []; for(i = 0 ; i <myObj.features.length; i++){ if(myObj.features.attributes.Status == "FromPoint"){ fromPoint = new Point(parseFloat(myObj.features.attributes.Longitude),parseFloat(myObj.features.attributes.Latitude),new SpatialReference({wkid:4326})); frmGraphicsLayer.add((new Graphic(fromPoint,symbol2))); } else{ var pt = new Point(parseFloat(myObj.features.attributes.Longitude),parseFloat(myObj.features.attributes.Latitude),new SpatialReference({wkid:4326})); toPoints.push(pt); } } task = array.map(toPoints,lang.hitch(this, function (toPoint) { var distParams = new esri.tasks.DistanceParameters(); distParams.distanceUnit = esri.tasks.GeometryService.UNIT_SQUARE_METERS; distParams.geometry1 = fromPoint; distParams.geometry2 = toPoint; distParams.geodesic = true; return distParams; })); for (i = 0; i < task.length; i++) { promises.push(geometryService.distance(task)); } var iPromises = new all(promises); iPromises.then(lang.hitch(this, function (distance) { if (isNaN(distance)) { distance = 0; } if(distance >70){ toGraphicsLayer.add((new Graphic(pt,symbol3))); } else{ toGraphicsLayer.add((new Graphic(pt,symbol1))); } }), lang.hitch(this, function (err){ console.info(err); })); map.addLayer(frmGraphicsLayer); map.addLayer(toGraphicsLayer); }); </script> </head> <body> <div id="mapDiv"></div> </body> </html> i have referred this thread How to nest dojo async calls and wait until all are complete but no success
... View more
06-26-2018
06:01 AM
|
0
|
1
|
664
|
POST
|
Hi, I am trying to print map using the below code- var legendLayer = new LegendLayer(); legendLayer.layerId = this.map.layerIds[1]; legendLayer.subLayerIds = [0,1]; // legendLayer.subLayerIds = [1]; var url = "https://MachineName:6443/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task"; var printTask = new PrintTask(url); var params = new PrintParameters(); var template = new PrintTemplate(); template.format = "PDF"; template.layout = "A4 Landscape"; template.layoutOptions = {"legendLayers": [legendLayer], // empty array means no legend "titleText": "Map Print", "authorText": "Insight", "copyrightText": "LTI", "scalebarUnit": "Kilometers"}; template.preserveScale = false; debugger; template.exportOptions = { width:30, height:60, dpi:96 }; params.map = this.map; params.template = template; printTask.on("error",lang.hitch(this, this._printResultError)); printTask.execute(params, lang.hitch(this, this._printResult)); } The above code works fine in for WAB 2.5 using ArcGIS JavaScript API 3.21 with dynamic Map service Layer as a basemap. Please find below image for the same without any error any console window Whereas same code, with WAB 2.6 using ArcGIS JavaScript API 3.22 with tiled map service as a basemap is not working.Please find image below I found that the request for WAB 2.5 serves GET request, whereas WAB 2.6 serves POST request by default. Also when i check server manager logs it s saying "error 000735: web map as JSON:Value is required". Please find below image- How to resolve this issue?? Thanks, Shaikh
... View more
03-27-2018
07:48 AM
|
0
|
0
|
325
|
POST
|
Hi, I am using WAB 2.6, want to add token to header while sending the request to proxy URL, How can i add it? Thanks, Rizuan
... View more
02-28-2018
02:04 AM
|
0
|
0
|
510
|
Title | Kudos | Posted |
---|---|---|
1 | 08-07-2016 09:37 PM | |
1 | 07-02-2019 04:43 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|