POST
|
05-20-2020
12:15 PM
|
0
|
1
|
260
|
POST
|
I have an array of projected (X,Y) points, which I am trying to convert to array of (lat,long). I wrote the following method which will take a single (X, Y ) and give me ( Lat, Long). This works. But I do not know how to use this to process my (X,Y) array. This should be simple, but could not get it.
function getLatLong(X,Y){
return (new Promise(function (resolve, reject) {
require(["esri/tasks/GeometryService",
"esri/geometry/Point",
"esri/tasks/ProjectParameters",
"esri/SpatialReference"],
function (GeometryService, Point, ProjectParameters, SpatialReference) {
var XCoord = parseInt(X, 10);
var YCoord = parseInt(Y, 10);
var inSR = new SpatialReference({wkid: 2274});
var outSR = new SpatialReference({wkid: 4326});
var gsvc = new GeometryService("https://mapviewtest.memphistn.gov/arcgis/rest/services/Utilities/Geometry/GeometryServer");
var inputpoint = new Point(XCoord, YCoord, inSR);
var prjParams = new ProjectParameters();
prjParams.geometries = [inputpoint];
prjParams.outSR = outSR;
gsvc.project(prjParams);
gsvc.on("project-complete",function(outputpoint){
resolve(outputpoint);
});
gsvc.on("error",function(err){
reject(err);
})
});
}));//promise
} Thanks Muralidhar Moka
... View more
07-24-2019
02:05 PM
|
0
|
1
|
1137
|
POST
|
Hi, Thanks for the response. We are not using the proxy. We want to do without the proxy. Thanks Muralidhar Moka
... View more
05-23-2019
09:04 AM
|
0
|
1
|
458
|
POST
|
We are tying to upload attachments using featureLayer.addAttachment operation. We are using ArcGIS javascript API 3.8 and Emberjs. Note: We do not have a proxy for our ArcGIS server. // The proxy url you see does not work. is it necessary to use a proxy? Can we do without it. Here is the code file.hbs ======= <div class="form-group">
<div class="col-sm-12 col-md-7 col-lg-7">
<form id="myForm">
<div class="col-sm-8"> <input type="file" name="attachment" /></div>
<div class="col-sm-4"> <button class="btn btn-success" type="submit" id="upload"
{{action "addAttachments" }}>Submit</button></div>
</form>
</div>
</div> file_controller.js ============ addAttachments:function(){
var controller = this;
require([
'esri/layers/FeatureLayer'
],
function (
FeatureLayer
) {
esri.config.defaults.io.proxyUrl = "https://mapviewtest.memphistn.gov/proxy/proxy.ashx";
esri.config.defaults.io.alwaysUseProxy = false;
var objId = controller.get('projObjectId');
var attchUrl = App.Config.services.pmsPhotoService + objId;
var featureLayer = new FeatureLayer(attchUrl);
var form = document.getElementById("myForm");
featureLayer.addAttachment(objId, form ,callback , function(err){
console.log(err);
});
function callback(result){
console.log(result);
}
});
}, Here is the log of console with all variables and err message and snap of the same log. our attachment url has no problem. Here is the console log objId 18015 attchUrl "https://mapviewtest.memphistn.gov/arcgis/rest/services/AGO_GeneralServices/PMS_WOMS/FeatureServer/1/18015" <form id="myForm"><div class="col-sm-8"><input type="file" name="attachment"></div><div class="col-sm-4">…</div></form> dev.html#/projectDashBoard:1 Access to XMLHttpRequest at 'https://mapviewtest.memphistn.gov/proxy/proxy.ashx?https://mapviewtest.memphistn.gov/arcgis/rest/services/AGO_GeneralServices/PMS_WOMS/FeatureServer/1/18015/18015/addAttachment' from origin 'http://localhost:9876' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. init.js:187 r {message: "Unable to load https://mapviewtest.memphistn.gov/p…atureServer/1/18015/18015/addAttachment status: 0", response: {…}, status: 0, responseText: "", xhr: XMLHttpRequest, …} w @ init.js:187 (anonymous) @ init.js:186 c @ init.js:74 d @ init.js:74 resolve.callback @ init.js:75 c @ init.js:74 d @ init.js:74 reject.errback @ init.js:76 c @ init.js:74 d @ init.js:74 reject.errback @ init.js:76 c @ init.js:74 d @ init.js:74 reject.errback @ init.js:76 (anonymous) @ init.js:190 f @ init.js:194 q @ init.js:194 w.reject @ init.js:197 a @ init.js:195 f @ init.js:195 q @ init.js:194 w.reject @ init.js:197 a @ init.js:195 f @ init.js:195 q @ init.js:194 w.reject @ init.js:197 a @ init.js:195 f @ init.js:195 q @ init.js:194 w.reject @ init.js:197 a @ init.js:195 f @ init.js:195 q @ init.js:194 w.reject @ init.js:197 r @ init.js:156 h @ init.js:160 error (async) d @ init.js:160 f @ init.js:157 b.xhr @ init.js:190 b.rawXhrPost.b.xhrPost @ init.js:191 v @ init.js:466 d @ init.js:468 B @ init.js:473 _sendAttachment @ FeatureLayer.js:86 addAttachment @ FeatureLayer.js:55 (anonymous) @ app/controllers/projectDashBoard_controller.js:779 ga @ init.js:32 (anonymous) @ init.js:24 ha @ init.js:32 Ma @ init.js:24 p @ init.js:15 addAttachments @ app/controllers/projectDashBoard_controller.js:766 send @ lib-dev.js:34902 (anonymous) @ lib-dev.js:53661 run @ lib-dev.js:24306 Ember.run @ lib-dev.js:24685 handler @ lib-dev.js:53659 (anonymous) @ lib-dev.js:38415 Ember.handleErrors @ lib-dev.js:19257 (anonymous) @ lib-dev.js:38407 dispatch @ lib-dev.js:9009 elemData.handle @ lib-dev.js:8685 Show 6 more frames err r {message: "Unable to load https://mapviewtest.memphistn.gov/p…atureServer/1/18015/18015/addAttachment status: 0", response: {…}, status: 0, responseText: "", xhr: XMLHttpRequest, …}log: undefinedmessage: "Unable to load https://mapviewtest.memphistn.gov/proxy/proxy.ashx?https://mapviewtest.memphistn.gov/arcgis/rest/services/AGO_GeneralServices/PMS_WOMS/FeatureServer/1/18015/18015/addAttachment status: 0"response: {url: "https://mapviewtest.memphistn.gov/proxy/proxy.ashx…MS_WOMS/FeatureServer/1/18015/18015/addAttachment", options: a, getHeader: ƒ, xhr: XMLHttpRequest, status: 0, …}responseText: ""status: 0xhr: XMLHttpRequest {onreadystatechange: null, readyState: 0, timeout: 0, withCredentials: false, upload: XMLHttpRequestUpload, …}_ssl: undefinedstack: "Error: Unable to load https://mapviewtest.memphistn.gov/proxy/proxy.ashx?https://mapviewtest.memphistn.gov/arcgis/rest/services/AGO_GeneralServices/PMS_WOMS/FeatureServer/1/18015/18015/addAttachment status: 0↵ at new r (http://js.arcgis.com/3.8compact/init.js:221:367)↵ at XMLHttpRequest.h (http://js.arcgis.com/3.8compact/init.js:160:167)"__proto__: Error
... View more
05-22-2019
08:30 AM
|
0
|
3
|
560
|
POST
|
I know, This question looks weird. We customised code in the Geoform. We select the Facility from the Facility Dropdown (red color) //its a point We add this point to the map //(yellow color) We then go and click the Map, which gives us a Blue Icon Then we submit the form. So instead we thought, we can select the facility and click on the map automatically, so that we can get the Blue Icon. Following is the Esri's geoform code for clicking(This is not our code) // I am also thinking to use this code some how if there is no way of clicking. // map click on(this.map, 'click', lang.hitch(this, function (evt) { debugger; //remove the location-error message as soon as the point on the map is selected. this._removeErrorNode(dom.byId("select_location").nextSibling); this._clearSubmissionGraphic(); this.addressGeometry = evt.mapPoint; this._setSymbol(this.addressGeometry, true); // get coords string var coords = this._calculateLatLong(evt.mapPoint); domAttr.set(dom.byId("coordinatesValue"), "innerHTML", coords); this._setCoordInputs(evt.mapPoint); })); Please suggest what we need to do here. Thanks.
... View more
04-16-2019
08:15 AM
|
0
|
2
|
700
|
POST
|
Hi, Here is a method which will querying for a point. QueryTask returns the point and then we add the point to the map. I would like to dynamically click at the point location. How can I do that. showFacilityGeometry :function(facilityId){ var queryTask = new QueryTask("http://mapviewtest.memphistn.gov/arcgis/rest/services/AGO_GeneralServices/PMS_WOMS/MapServer/1"); var query = new Query(); query.where = "FACILITY_ID='" + facilityId + "'"; query.outFields=['*']; query.returnGeometry = true; this.map.graphics.clear(); queryTask.execute(query).then(lang.hitch(this,function(feature){ //Here I get a point geometry and we create symbol for that point. var geometry = feature.features[0].geometry; var pointSymbol = new SimpleMarkerSymbol(); pointSymbol.setColor(new Color([255, 255, 0, 0.5])); //create graphic and add graphic var graphic = new Graphic(geometry, pointSymbol); this.map.graphics.add(graphic); //Here I want to dynamically click the map at the above point??? How to do this? //zoom to the point geometry. added padding to the extension var PointExtent = new Extent(geometry.x - 250, geometry.y - 250, geometry.x + 250, geometry.y + 250); PointExtent.spatialReference = new SpatialReference({ wkid: 102736 }); this.map.setExtent(PointExtent); })); },
... View more
04-15-2019
01:24 PM
|
0
|
5
|
774
|
POST
|
Hi, I have a Custom Widget on left, which has a clear button. I have a query Widget on the right (red color), which shows some results. Question: How do I clear the results on the query widget by clicking the clear button. Also How do I clear the graphics from the map. this.map.graphics.clear only removes my buffer not the (voilet Symbols). I tried the following code, but did not work. clearAll:function(){ var qWidget = WidgetManager.getInstance().getWidgetsByName("Query")[0]; debugger; if(qWidget){ qWidget._updateResultDetailUI(); } },
... View more
03-07-2019
10:38 AM
|
0
|
2
|
613
|
POST
|
Looks like the error is on our side. ignore the above error.
... View more
02-26-2019
10:08 AM
|
0
|
0
|
665
|
POST
|
Hi, Can we start a Python script from a widget on a button Click. Say I will have a button and Textbox for location of the file. I saw an earlier post on this in the community, but there was not satisfactory answer. Note: our python script is reading attributes data and writing excel files Thanks Muralidhar Moka.
... View more
01-07-2019
09:31 AM
|
0
|
1
|
1058
|
POST
|
I am Trying to display data in a Grid using "OnDemandGrid". I am using Webappbuilder 2.10. The data displays perfectly. but the first row overlaps with the header. How do I fix this. Here is the code. Also attached all the code. Widget.js define(['dojo/_base/declare',
'jimu/BaseWidget',
'dojo/_base/lang',
'dojo/Deferred',
'dgrid1/OnDemandList',
'dgrid1/OnDemandGrid',
'dgrid1/Grid',
'dgrid1/Selection',
"dojo/store/Memory",
'dstore/RequestMemory',
"dgrid1/extensions/ColumnHider",
"dstore/legacy/StoreAdapter"
],
function(declare,
BaseWidget,
lang,
Deferred,
OnDemandList,
OnDemandGrid,
Grid,
Selection,
Memory,
RequestMemory,
ColumnHider,
StoreAdapter) {
//To create a widget, you need to derive from BaseWidget.
return declare([BaseWidget], {
baseClass: 'jimu-widget-listview',
//methods to communication with app container:
postCreate: function() {
this.inherited(arguments);
console.log('ListView::postCreate');
this.createOnDemandGrid();
},
startup: function() {
this.inherited(arguments);
},
createOnDemandGrid:function(){
var dataStore = new StoreAdapter({
objectStore: new Memory({
idProperty: "objectId"
})
});
var columns=[
{ field: "objectId",
label: "__OBJECTID",
sortable: true,
hidden: true
},
{ field: "firstName",
label: "FIRST_NAME",
sortable: true
},
{ field: "lastName",
label: "LAST_NAME",
sortable: true
}
];
var grid = new(OnDemandGrid.createSubclass([Selection, ColumnHider]))({
columns: columns
}, this.grid);
grid.on("dgrid-select", this.selectFeatureFromGrid);
dataStore.objectStore.data =[
{objectId:1,firstName:'Muralidhar',lastName:"Moka"},
{objectId:2,firstName:'Muralidhar',lastName:"Moka"},
{objectId:3,firstName:'Muralidhar',lastName:"Moka"},
{objectId:4,firstName:'Muralidhar',lastName:"Moka"},
{objectId:5,firstName:'Muralidhar',lastName:"Moka"}
];
grid.set("collection", dataStore);
grid.startup();
},
selectFeatureFromGrid:function(){
debugger;
},
});
}); widget.html <div>
<div data-dojo-attach-point="grid"></div>
</div>
... View more
12-27-2018
01:24 PM
|
0
|
1
|
552
|
POST
|
Hi, We have downloaded an Webapplication from Arcgis online. in the downloaded application. There is Config.json. in this file. I see this "settings":{
}
can any one tell me how to use this. //I am sure, this is to load the Settings UI. Thanks Muralidhar Moka.
... View more
12-21-2018
01:29 PM
|
0
|
1
|
213
|
POST
|
Hi, We are trying to open a Collector App from a href link in an mobile web browser. It works fine on IOS but fails on android. Description: We created a web Application in javascript & HTML5 and the application has a webpage with links. We have a requirement to open a collector app by clicking on one of the link, when we access this application on a phone. Our href link code is as follows. <a href="arcgis-collector://"> <img src="..." width="100" height="100"> </a>. This works for IOS but not Android. Has any one came across such a problem ? if so , would you please share us your solution with us. Thanks Muralidhar Moka
... View more
09-16-2016
07:50 AM
|
0
|
0
|
1019
|
POST
|
cannot render a thematic map, color wont show. Hi trying to create a thematic map for a feature Layer. Here is what I did. I. created a map. 2.Created a basemap layer and added it to the map. 3.created a feature layer and added it to the map. 4.then tried to use the smartMapping.createClassedColorRender ( I set baseMap like baseMap:map). 5.what I get is I only see the featurelayer boudries with some color. but the featureLayer polygons are not colored. may be in step 4. I did not set my baseMap layer correctly(do not know how to do it). Can any one help me, what my mistake is. I used the following as an example from ArcGIS javascript samples. Smart Mapping - Render class breaks with color | ArcGIS API for JavaScript Here is the code. showThematicMap_back:function() { //global vars var layer, legend; var controller = this; require([ "esri/map", "esri/dijit/PopupTemplate", "esri/layers/FeatureLayer", "esri/layers/ArcGISDynamicMapServiceLayer", "esri/dijit/Legend", "esri/renderers/smartMapping", "dojo/_base/array", "dojo/dom", "dojo/dom-construct", "dojo/data/ItemFileReadStore", "dijit/form/FilteringSelect", "esri/Color", "dojo/parser", "dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dojo/domReady!" ], function ( Map, PopupTemplate, FeatureLayer, ArcGISDynamicMapServiceLayer, Legend, smartMapping, array, dom, domConstruct, ItemFileReadStore, FilteringSelect, Color, parser ) { parser.parse(); var mapPageController = controller.get('controllers.mapPage'); var map = mapPageController.get('map'); //select the filed Name var fieldName = "UNIT"; var outFields = ["UNIT"]; //create popup for template //label is just a text field that apprears on template var popupTemplate = new PopupTemplate({ title: "{UNIT}", fieldInfos: [{ "fieldName": fieldName, "label": fieldName, "visible": true, "format": { places: 0, digitSeparator: true } }], showAttachments: true }); layer = new FeatureLayer("http://memgisdev.memphis.ad/arcgis/rest/services/DPD/Boundaries2010UTM16N/MapServer/0", { "id": "Washington", "infoTemplate": popupTemplate, "mode": FeatureLayer.MODE_SNAPSHOT, "outFields": outFields, "opacity": 0.8 }); //set Definition expression to filter the features you want to show //layer.setDefinitionExpression("STATE_NAME='Washington'"); map.addLayer(layer); layer.on("load", function () { createRenderer(fieldName); }); function createRenderer(field) { //smart mapping functionality begins smartMapping.createClassedColorRenderer({ layer: layer, field: field, basemap:map, classificationMethod: "natural-breaks", numClasses: 10 }).then(function (response) { layer.setRenderer(response.renderer); layer.redraw(); createLegend(map, layer, field); }); } //Create a legend function createLegend(map, layer, field) { //If applicable, destroy previous legend if (legend) { legend.destroy(); domConstruct.destroy(dom.byId("legendDiv")); } // create a new div for the legend var legendDiv = domConstruct.create("div", { id: "legendDiv" }, dom.byId("legendWrapper")); legend = new Legend({ map: map, layerInfos: [{ layer: layer, title: "Census Attribute: " + field }] }, legendDiv); legend.startup(); } }); },
... View more
05-13-2016
09:18 AM
|
0
|
0
|
1495
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|