POST
|
Dear All I am facing problem when i execute arcgis geoprocessing rest service by using arcgis api 4.21. This is my below code i am executing. var gpUrl= "url"; params = { "Web_Map_as_JSON": "", "": , "": ": "":, "": , "": }; geoprocessor.execute(gpUrl, params, options).then(showResults, OnError); it nothing returns.no exception no error. But when i execute the same service with arcgis api 3.29.It runs and i get a pdf file in response. var gpUrl= new Geoprocessor("url"); params = { "Web_Map_as_JSON": "", "": , "": ": "":, "": , "": }; gp.execute(params, showResults, OnError); Please help me to solve this issue.i have to finish this task. Thanks in advance.
... View more
05-24-2022
11:12 PM
|
0
|
0
|
455
|
POST
|
<html> <head> <meta charset="utf-8" /> <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" /> <title>Identify | Sample | ArcGIS API for JavaScript 4.23</title> <style> html, body, #viewDiv { padding: 0; margin: 0; height: 100%; width: 100%; } .esri-popup .esri-popup-header .esri-title { font-size: 18px; font-weight: bolder; } .esri-popup .esri-popup-body .esri-popup-content { font-size: 14px; } </style> <link rel="stylesheet" href="https://js.arcgis.com/4.23/esri/themes/light/main.css" /> <script src="https://js.arcgis.com/4.23/"></script> <script> require([ "esri/Map", "esri/views/MapView", "esri/layers/MapImageLayer", "esri/rest/identify", "esri/rest/support/IdentifyParameters" ], function (Map, MapView, MapImageLayer, identify, IdentifyParameters) { var params; // URL to the map service where the identify will be performed var identifyURL = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/MtBaldy_BaseMap/MapServer"; // Add the map service as a MapImageLayer // use identify to query the service to add interactivity to the app var identifyLayer = new MapImageLayer({ url: identifyURL, opacity: 0.5 }); var map = new Map({ basemap: "osm" }); map.add(identifyLayer); var view = new MapView({ map: map, container: "viewDiv", center: [-117.23502, 34.23911], zoom: 13 }); view.when(function () { // executeIdentify() is called each time the view is clicked view.on("click", executeIdentify); // Set the parameters for the identify params = new IdentifyParameters(); params.tolerance = 3; params.layerIds = [0, 1, 2, 3, 4]; params.layerOption = "All"; params.width = view.width; params.height = view.height; }); // Executes each time the view is clicked function executeIdentify(event) { // Set the geometry to the location of the view click params.geometry = event.mapPoint; params.mapExtent = view.extent; document.getElementById("viewDiv").style.cursor = "wait"; // This function returns a promise that resolves to an array of features // A custom popupTemplate is set for each feature based on the layer it // originates from identify .identify(identifyURL, params) .then(function (response) { var results = response.results; return results.map(function (result) { var feature = result.feature; var layerName = result.layerName; feature.attributes.layerName = layerName; if (layerName === "Landuse") { feature.popupTemplate = { // autocasts as new PopupTemplate() title: layerName, content: "<b>Block ID:</b> {BLOCK_ID} " + "<br><b>Geometry Type:</b> {Shape}" + "<br><b>Landuse Area:</b> {Shape_Area}"+ "<br><label for=rdComp >اسم الشركة</label><input type=radio id= rdComp name=rdGroup value=Comp checked=checked></><br>" }; } } return feature; }); }) .then(showPopup); // Send the array of features to showPopup() // Shows the results of the identify in a popup once the promise is resolved function showPopup(response) { if (response.length > 0) { view.popup.open({ features: response, location: event.mapPoint }); } document.getElementById("viewDiv").style.cursor = "auto"; } } }); </script> </head> <body> <div id="viewDiv"></div> </body> </html> when user click i want to check the status of radio button.please help.i am using 4.23 arcgis api. Thanks
... View more
05-22-2022
04:50 AM
|
0
|
0
|
576
|
POST
|
i have solved this issue. if you return div not string the readio button will be display. like fallowing script var div= document.createElement("div"); div.innerHTML=HTML String;
... View more
05-22-2022
04:43 AM
|
0
|
0
|
589
|
POST
|
<html> <head> <meta charset="utf-8" /> <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" /> <title>Identify | Sample | ArcGIS API for JavaScript 4.23</title> <style> html, body, #viewDiv { padding: 0; margin: 0; height: 100%; width: 100%; } .esri-popup .esri-popup-header .esri-title { font-size: 18px; font-weight: bolder; } .esri-popup .esri-popup-body .esri-popup-content { font-size: 14px; } </style> <link rel="stylesheet" href="https://js.arcgis.com/4.23/esri/themes/light/main.css" /> <script src="https://js.arcgis.com/4.23/"></script> <script> require([ "esri/Map", "esri/views/MapView", "esri/layers/MapImageLayer", "esri/rest/identify", "esri/rest/support/IdentifyParameters" ], function (Map, MapView, MapImageLayer, identify, IdentifyParameters) { var params; // URL to the map service where the identify will be performed var identifyURL = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/MtBaldy_BaseMap/MapServer"; // Add the map service as a MapImageLayer // use identify to query the service to add interactivity to the app var identifyLayer = new MapImageLayer({ url: identifyURL, opacity: 0.5 }); var map = new Map({ basemap: "osm" }); map.add(identifyLayer); var view = new MapView({ map: map, container: "viewDiv", center: [-117.23502, 34.23911], zoom: 13 }); view.when(function () { // executeIdentify() is called each time the view is clicked view.on("click", executeIdentify); // Set the parameters for the identify params = new IdentifyParameters(); params.tolerance = 3; params.layerIds = [0, 1, 2, 3, 4]; params.layerOption = "All"; params.width = view.width; params.height = view.height; }); // Executes each time the view is clicked function executeIdentify(event) { // Set the geometry to the location of the view click params.geometry = event.mapPoint; params.mapExtent = view.extent; document.getElementById("viewDiv").style.cursor = "wait"; // This function returns a promise that resolves to an array of features // A custom popupTemplate is set for each feature based on the layer it // originates from identify .identify(identifyURL, params) .then(function (response) { var results = response.results; return results.map(function (result) { var feature = result.feature; var layerName = result.layerName; feature.attributes.layerName = layerName; if (layerName === "Landuse") { feature.popupTemplate = { // autocasts as new PopupTemplate() title: layerName, content: "<b>Block ID:</b> {BLOCK_ID} " + "<br><b>Geometry Type:</b> {Shape}" + "<br><b>Landuse Area:</b> {Shape_Area}"+ "<br><label for=rdComp >اسم الشركة</label><input type=radio id= rdComp name=rdGroup value=Comp checked=checked></><br>" }; } } return feature; }); }) .then(showPopup); // Send the array of features to showPopup() // Shows the results of the identify in a popup once the promise is resolved function showPopup(response) { if (response.length > 0) { view.popup.open({ features: response, location: event.mapPoint }); } document.getElementById("viewDiv").style.cursor = "auto"; } } }); </script> </head> <body> <div id="viewDiv"></div> </body> </html> Dear All i want to add radio button inside a popup.i have successfully add this button in 3.4.But i cant add this in 4.23.Please help me to solve this issue.When i run the identify tool i just see label but no radio button.please help. Thanks in advance.
... View more
05-22-2022
01:57 AM
|
0
|
1
|
626
|
POST
|
Dear All i want to publish arcgis rest service.but i am missing option mobile data access in sevice editor properties dialog box.how can it be visible. i have an arcgis enterprise license.i also read 10.8 documentation.this option is not obselete.for this i am also attaching one image of 10.8 help document.please help me for this.i will be very thankfull to all my friends.
... View more
04-16-2022
09:58 AM
|
0
|
0
|
265
|
POST
|
sorry for late reply.the below code is working with me on 10.6 and 10.7 private IWorkspace getWorkspace() { ESRI.ArcGIS.esriSystem.AoInitialize aoInit = null; esriLicenseStatus licStatus; IWorkspace workspace = null; string status = ""; try { Console.WriteLine("Obtaining license"); if (ESRI.ArcGIS.RuntimeManager.ActiveRuntime == null) ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop); aoInit = new ESRI.ArcGIS.esriSystem.AoInitialize(); licStatus = aoInit.Initialize(esriLicenseProductCode.esriLicenseProductCodeStandard); if (licStatus == esriLicenseStatus.esriLicenseCheckedOut) { Console.WriteLine("Ready with license."); if (ESRI.ArcGIS.RuntimeManager.ActiveRuntime == null) ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop); IPropertySet propertySet = new PropertySet(); propertySet.SetProperty("SERVER", "IP"); propertySet.SetProperty("INSTANCE", "5151");------For arcsde application server propertySet.SetProperty("INSTANCE", "sde:sqlserver:sqlservername");------For direct connect. propertySet.SetProperty("DATABASE", "database"); propertySet.SetProperty("USER", "user"); propertySet.SetProperty("PASSWORD", "user"); propertySet.SetProperty("Authentication_mode", "DBMS"); propertySet.SetProperty("VERSION", "SDE.DEFAULT"); Type factoryType = Type.GetTypeFromProgID("esriDataSourcesGDB.SdeWorkspaceFactory"); IWorkspaceFactory workspaceFactory = (IWorkspaceFactory)Activator.CreateInstance(factoryType); workspace = workspaceFactory.Open(propertySet, 0); if (workspace != null) { return workspace; } } } catch (Exception ex) { Console.WriteLine(ex.Message); status = ex.Message.ToString()+" "+ex.Source; } return workspace; }
... View more
07-20-2020
12:19 AM
|
0
|
1
|
1458
|
POST
|
propertySet.SetProperty("SERVER", "IP"); propertySet.SetProperty("INSTANCE", "sde:sqlServer:ServerName");-----this is the line i change propertySet.SetProperty("DATABASE", "database"); propertySet.SetProperty("USER", "user"); propertySet.SetProperty("PASSWORD", "user"); propertySet.SetProperty("Authentication_mode", "DBMS"); propertySet.SetProperty("VERSION", "SDE.DEFAULT"); Its working like above settings. Thanks
... View more
07-20-2020
12:15 AM
|
0
|
0
|
1090
|
POST
|
Dear All, we have geodatabase in 10.5 and sql server 2016.i have to write one web service.before we connect to geodatabase when arcsde application server insatlled.But after 10.3 ESRI obselete ARCSDE server.so in my new enviornment i dont have SDE server installation.below function return worksapce in old envirnment.But SDE finish.I cant connect to geodatabase in new enviornemt.so how to connect to geodatabse without SDE server installation Thanks. Below code through exception SDE not running.How to solve this in 10.5 arcobjects SDK my geodatabase is in 2016 sq server.i know sdeserver not install.But i want to connect to geodattabase without sde server. private IWorkspace getWorkspace() { ESRI.ArcGIS.esriSystem.AoInitialize aoInit = null; esriLicenseStatus licStatus; IWorkspace workspace = null; string status = ""; try { Console.WriteLine("Obtaining license"); if (ESRI.ArcGIS.RuntimeManager.ActiveRuntime == null) ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop); aoInit = new ESRI.ArcGIS.esriSystem.AoInitialize(); licStatus = aoInit.Initialize(esriLicenseProductCode.esriLicenseProductCodeStandard); if (licStatus == esriLicenseStatus.esriLicenseCheckedOut) { Console.WriteLine("Ready with license."); if (ESRI.ArcGIS.RuntimeManager.ActiveRuntime == null) ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop); IPropertySet propertySet = new PropertySet(); propertySet.SetProperty("SERVER", "IP"); propertySet.SetProperty("INSTANCE", "5151"); propertySet.SetProperty("DATABASE", "database"); propertySet.SetProperty("USER", "user"); propertySet.SetProperty("PASSWORD", "user"); propertySet.SetProperty("Authentication_mode", "DBMS"); propertySet.SetProperty("VERSION", "SDE.DEFAULT"); Type factoryType = Type.GetTypeFromProgID("esriDataSourcesGDB.SdeWorkspaceFactory"); IWorkspaceFactory workspaceFactory = (IWorkspaceFactory)Activator.CreateInstance(factoryType); workspace = workspaceFactory.Open(propertySet, 0); if (workspace != null) { return workspace; } } } catch (Exception ex) { Console.WriteLine(ex.Message); status = ex.Message.ToString()+" "+ex.Source; } return workspace; }
... View more
07-15-2020
04:04 AM
|
0
|
2
|
1163
|
POST
|
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" /> <title>Measurement in 2D - 4.15</title> <style> html, body, #viewDiv { padding: 0; margin: 0; height: 100%; width: 100%; } #topbar { background: #fff; padding: 10px; } .action-button { font-size: 16px; background-color: transparent; border: 1px solid #d3d3d3; color: #6e6e6e; height: 32px; width: 32px; text-align: center; box-shadow: 0 0 1px rgba(0, 0, 0, 0.3); } .action-button:hover, .action-button:focus { background: #0079c1; color: #e4e4e4; } .active { background: #0079c1; color: #e4e4e4; } </style> <link rel="stylesheet" href="https://js.arcgis.com/4.15/esri/themes/light/main.css" /> <script src="https://js.arcgis.com/4.15/"></script> <script> require([ "esri/views/MapView", "esri/WebMap", "esri/widgets/DistanceMeasurement2D", "esri/widgets/AreaMeasurement2D" ], function(MapView, WebMap, DistanceMeasurement2D, AreaMeasurement2D) { var activeWidget = null; // load a webmap const webmap = new WebMap({ portalItem: { id: "990d0191f2574db495c4304a01c3e65b" } }); // create the map view const view = new MapView({ container: "viewDiv", map: webmap }); // add the toolbar for the measurement widgets view.ui.add("topbar", "top-right"); document .getElementById("distanceButton") .addEventListener("click", function() { setActiveWidget(null); if (!this.classList.contains("active")) { setActiveWidget("distance"); } else { setActiveButton(null); } }); document .getElementById("areaButton") .addEventListener("click", function() { setActiveWidget(null); if (!this.classList.contains("active")) { setActiveWidget("area"); } else { setActiveButton(null); } }); function setActiveWidget(type) { switch (type) { case "distance": activeWidget = new DistanceMeasurement2D({ view: view }); // skip the initial 'new measurement' button activeWidget.viewModel.newMeasurement(); view.ui.add(activeWidget, "top-right"); setActiveButton(document.getElementById("distanceButton")); break; case "area": activeWidget = new AreaMeasurement2D({ view: view }); // skip the initial 'new measurement' button activeWidget.viewModel.newMeasurement(); view.ui.add(activeWidget, "top-right"); setActiveButton(document.getElementById("areaButton")); break; case null: if (activeWidget) { view.ui.remove(activeWidget); activeWidget.destroy(); activeWidget = null; } break; } } function setActiveButton(selectedButton) { // focus the view to activate keyboard shortcuts for sketching view.focus(); var elements = document.getElementsByClassName("active"); for (var i = 0; i < elements.length; i++) { elements.classList.remove("active"); } if (selectedButton) { selectedButton.classList.add("active"); } } const measurement = new Measurement(); measurement.watch("activeWidget", function(evt){ if(evt.label === "distanceButton"){ alert("if"); console.info(evt.viewModel.palette); evt.viewModel.palette.handleColor = [255,0,0,0.8] evt.viewModel.palette.pathPrimaryColor = [255,0,0,1]; evt.viewModel.palette.pathSecondaryColor = [128,128,128,1]; }else{ alert("else"); console.info(evt.viewModel.palette); evt.viewModel.palette.pathColor = [255,0,0,1]; evt.viewModel.palette.handleColor = [255,0,0,0.8]; evt.viewModel.palette.fillColor = [255,0,0,0.3]; } }); }); </script> </head> <body> <div id="viewDiv"></div> <div id="topbar"> <button class="action-button esri-icon-measure-line" id="distanceButton" type="button" title="Measure distance between two or more points" ></button> <button class="action-button esri-icon-measure-area" id="areaButton" type="button" title="Measure area" ></button> </div> </body> </html> the above is me testing code.i applied the which you give it to me.But it not making any effect. Thanks
... View more
07-06-2020
02:00 AM
|
0
|
2
|
2492
|
POST
|
Dear all I want to change the default symbology of area and line tools that comes with measurement widgets in arcgis java script api 4.15. i want my own custom symbology for both tools area and distance tools. Thanks.
... View more
07-04-2020
12:17 PM
|
1
|
7
|
2622
|
POST
|
Dear Robert , Any example for this.how to use this. Thanks
... View more
07-03-2020
11:12 AM
|
0
|
1
|
761
|
POST
|
Dear All in below image i use the coordinate conversion widget.and check gotolocation box.after putting input the location come on the map as a small white circle which shows on the image inside the red circle.i want to change symbology and put custom image on this place.how it is possible. Thanks in advance
... View more
07-03-2020
07:54 AM
|
0
|
3
|
813
|
POST
|
Dear Robert , thanks for you reply.But i want to place custom color for esri-widget__table which is inside widget popup. i make css class .esri-widget__table tr:nthChild(odd){ background-color:red; } .esri-widget__table tr:nthChild(even){ background-color:green; } but it did not make any impact on my popup. so please help. thanks again.
... View more
06-23-2020
12:02 PM
|
0
|
2
|
1293
|
POST
|
i am using arcgis gis 4.15.i want to set colors for alternative rows of popup datatable.How can i acheive this i tried it.but not successfull. Thanks.
... View more
06-23-2020
04:32 AM
|
0
|
4
|
1339
|
Title | Kudos | Posted |
---|---|---|
1 | 07-04-2020 12:17 PM |
Online Status |
Offline
|
Date Last Visited |
05-30-2023
10:23 PM
|