POST
|
Already I have set that property , see the below code attached. . Label is working for dynamic polygon layer (same code) . Its not working for the dynamic point layer. "map": { "3D": false, "2D": true, "position": { "left": 0, "top": 40, "right": 0, "bottom": 0 }, "itemId": "056a31fb8e614c06b69cf0c5ff9ca0d8", "mapOptions": {"showLabels":true}, "id": "map", "portalUrl": "https://servername:7443/arcgis" },
... View more
11-14-2017
08:51 PM
|
0
|
4
|
379
|
POST
|
Hi Robert, No sensitive information. This widget will read the excel file and display on the map. To read the excel file "jquery.min.js" and "xlsx.core.min.js" files needs to be added in the application. As you know we also need to modify the "main.js" file .Java script files( Reading excel) can be found in "ToReadExcelFile" folder. Also you can find the sample.xlsx file in “ToReadExcelFile" folder . Let me know if you need any further infomation is required.
... View more
11-13-2017
08:22 AM
|
0
|
8
|
719
|
POST
|
Yes Robert I will share my widget . Here is holiday so I can share it on Monday(11/13) only . My email id is mohannainar@gmail.com . Is it ok if I can send the code through email ? .
... View more
11-10-2017
08:13 PM
|
0
|
10
|
719
|
POST
|
Hi Robert, Yes only points are showing up in the map. I am creating dynamic feature layer(point), so I guess show label option will not visible in layer list widget. Am attaching the screen shot of Layer list widget. When I debug the code its not giving any error message . The same code(displaying label) is working for polygon dynamic layer.
... View more
11-09-2017
09:17 PM
|
0
|
12
|
719
|
POST
|
Hi Robert, I changed to Graphic , still i could not able to see the label information on the map.
... View more
11-08-2017
09:44 PM
|
0
|
14
|
719
|
POST
|
The below labeling code is working for polygon layer (created dynamically) but not the point layer(created dynamically). var statesColor = new Color("#060606"); var statesLabel = new TextSymbol().setColor(statesColor); statesLabel.font.setSize("12pt"); statesLabel.font.setFamily("arial"); var json = { "labelExpressionInfo": {"value": "{ENTITY_FIELD}"},"labelPlacement":"above-right" }; var labelClass = new LabelClass(json); labelClass.symbol = statesLabel; this.temporalLayer.setLabelingInfo([ labelClass ]); this.map.addLayer(this.temporalLayer); Complete code for point layer is below . The dynamic layer is geographic coordinate system . var pt = null; var jsonFS = new Object(); jsonFS.geometryType = "esriGeometryPoint"; var features = []; renderer = new SimpleRenderer(new SimpleMarkerSymbol()); renderer.symbol.setColor(selectedColor); for (i = 0; i < this.fromExcel.length; i++) { var attributeObj = new Object(); attributeObj.OBJECTID = i+1; attributeObj.LATITUDE = this.fromExcel[this.config.LAT_FIELD]; attributeObj.LONGITUDE = this.fromExcel[this.config.LONG_FIELD]; attributeObj[this.mainField] = this.fromExcel[this.mainField]; attributeObj[this.config.TIME_FIELD]= this.fromExcel[this.config.TIME_FIELD]; attributeObj[this.config.SLIDER_FIELD]= this.fromExcel[this.config.SLIDER_FIELD]; attributeObj[this.config.ENTITY_FIELD]= this.fromExcel[this.config.ENTITY_FIELD]; var feature = new Object(); feature.attributes = attributeObj; pt = new Point(this.fromExcel[this.config.LONG_FIELD],this.fromExcel[this.config.LAT_FIELD],this.map.spatialReference); feature.geometry = pt; features.push(feature); } jsonFS.features = features; var featureSet = new FeatureSet(jsonFS); var infoTemplate = new InfoTemplate(this.mainField + " : ${"+ this.mainField +"}", this.config.ENTITY_FIELD + " : ${"+ this.config.ENTITY_FIELD +"}<br>" + this.mainField + " : ${"+ this.mainField +"}<br>" + this.config.LAT_FIELD + " : ${"+ this.config.LAT_FIELD +"}<br>"+ this.config.LONG_FIELD + " : ${"+ this.config.LONG_FIELD +"}<br>"+ this.config.TIME_FIELD + " : ${"+ this.config.TIME_FIELD +"}<br>"); var featureCollection = { layerDefinition: { "displayFieldName": this.mainField, "geometryType": "esriGeometryPoint", "spatialReference": { "latestWkid": 4326, "wkid": 4326 }, "fields": [ { "name": "OBJECTID", "type": "esriFieldTypeOID", "alias": "OBJECTID" }, { "name": this.config.LAT_FIELD, "type": "esriFieldTypeString", "alias": this.config.LAT_FIELD }, { "name": this.config.LONG_FIELD, "type": "esriFieldTypeString", "alias": this.config.LONG_FIELD }, { "name": this.mainField, "type": "esriFieldTypeInteger",//"esriFieldTypeInteger", "alias": this.mainField }, { "name": this.config.TIME_FIELD, "type": "esriFieldTypeDate",//"esriFieldTypeInteger", "alias": this.config.TIME_FIELD }, { "name": this.config.SLIDER_FIELD, "type": "esriFieldTypeString", "alias": this.config.SLIDER_FIELD }, { "name": this.config.ENTITY_FIELD, "type": "esriFieldTypeString", "alias": this.config.ENTITY_FIELD }, { "name": "shape", "type": "esriFieldTypeGeometry", "alias": "shape" } ] }, featureSet: featureSet, "exceededTransferLimit": false }; var featureLayerOptions = { mode: FeatureLayer.MODE_SNAPSHOT, outFields: ["*"], infoTemplate: infoTemplate, id: "ENTITY DATA" }; this.temporalLayer = new FeatureLayer(featureCollection,featureLayerOptions); var extent = graphicsUtils.graphicsExtent(featureSet.features); this.map.setExtent(extent.expand(1.2)); this.temporalLayer.setRenderer(renderer); var statesColor = new Color("#060606"); var statesLabel = new TextSymbol().setColor(statesColor); statesLabel.font.setSize("12pt"); statesLabel.font.setFamily("arial"); var json = { "labelExpressionInfo": {"value": "{ENTITY_FIELD}"},"labelPlacement":"above-right" }; var labelClass = new LabelClass(json); labelClass.symbol = statesLabel; this.temporalLayer.setLabelingInfo([ labelClass ]); this.map.addLayer(this.temporalLayer);
... View more
11-08-2017
04:31 AM
|
0
|
16
|
1483
|
POST
|
The below code is working for geographic coordinate system(Both base map and operational layers are in GCS) . But when i switch to Projected coordinate system (both basemap and operational layer) the label is not working but rendering is happening. The temporal layer i am creating dynamically , not from the mapservice . Renderer : function (){ var statesColor = new Color("#060606"); var statesLabel = new TextSymbol().setColor(statesColor); statesLabel.font.setSize("14pt"); statesLabel.font.setFamily("arial"); var json = { "labelExpressionInfo": {"value": "{POPULATION}"} }; var labelClass = new LabelClass(json); labelClass.symbol = statesLabel; this.temporalLayer.setLabelingInfo([ labelClass ]); this.map.addLayer(this.temporalLayer); smartMapping.createClassedColorRenderer({ layer: this.temporalLayer, field: "POPULATION", basemap: "streets", classificationMethod: this.checkClassificationType.value, numClasses: this.checkClassificationNumber.value }).then(lang.hitch(this, function (response) { var colorArray = this.interpolateColors("rgb(" + this.fromColor.color.r + "," + this.fromColor.color.g + "," + this.fromColor.color.b +")", "rgb(" + this.toColor.color.r + "," + this.toColor.color.g + "," + this.toColor.color.b + ")", this.checkClassificationNumber.value); for (var i = 0; i < colorArray.length ; i++) { response.renderer.infos.symbol.color.r = colorArray[0]; response.renderer.infos.symbol.color.g = colorArray[1]; response.renderer.infos.symbol.color.b = colorArray[2]; } this.temporalLayer.setRenderer(response.renderer); this.temporalLayer.redraw(); })); }, interpolateColors : function (color1, color2, steps) { var stepFactor = 1 / (steps - 1), interpolatedColorArray = []; color1 = color1.match(/\d+/g).map(Number); color2 = color2.match(/\d+/g).map(Number); for (var i = 0; i < steps; i++) { interpolatedColorArray.push(this.interpolateColor(color1, color2, stepFactor * i)); } return interpolatedColorArray; }, interpolateColor:function (color1, color2, factor) { if (arguments.length < 3) { factor = 0.5; } var result = color1.slice(); for (var i = 0; i < 3; i++) { result = Math.round(result + factor * (color2 - color1)); } return result; },
... View more
10-06-2017
05:42 AM
|
0
|
0
|
313
|
POST
|
I have created custom feature layer and using it for GenerateRendererTask but nothing happening . My question is GenerateRendererTask will work in custom feature layer ? . If not what is the alternate method for doing class break renderer. I am attaching my code for reference.
... View more
10-04-2017
05:21 AM
|
0
|
2
|
656
|
POST
|
Thanks for the information Robert. Actually I am creating a layer with temporal data dynamically . The temporal information(population and Year) will come from the business table which is residing on some database(teradata) and spatial data coming from other data base. So i am joining spatial and business data and creating new feature layer (dynamically) . So my final layer(dynamic) will be look like below. shape state_name population(coming from business table) year(coming from business table) polygon TamilNadu 20000000 1990 polygon TamilNadu 30000000 1995 polygon TamilNadu 50000000 2000 I could not able to use esri time slider , because it says time property should be enabled in the map service . But in may case i am creating the custom dynamic layer so i could not able to use esri time slider. So i am using dijit horizontalslider , based on the year selection in time slider i need to display corresponding geometry on the Map . So i thought of using setdefinition expression to filter out only the required year . But as you mentioned that also limitation in dynamic layer . Is there any approach to solve this issue or any suggestion .
... View more
09-29-2017
02:40 AM
|
0
|
3
|
727
|
POST
|
Hi Robert, PFB code for the dynamic feature layer creation and DefinitiomExpression? CreateFeatureLayer : function (featureset) { var len = featureset.features.length; var attributeObj = null; var longi = null; var lat =null; var pt = null; var feature =null; var jsonFS = new Object(); jsonFS.geometryType = "esriGeometryPoint"; if (featureset.geometryType === 'esriGeometryPoint') { renderer = new SimpleRenderer(new SimpleMarkerSymbol()); } else if (featureset.geometryType === 'esriGeometryMultipoint') { renderer = new SimpleRenderer(new SimpleMarkerSymbol()); } else if (featureset.geometryType === 'esriGeometryPolyline') { renderer = new SimpleRenderer(new SimpleLineSymbol()); } else if (featureset.geometryType === 'esriGeometryPolygon') { renderer = new SimpleRenderer(new SimpleFillSymbol()); } if (featureset.geometryType === 'esriGeometryPoint' || featureset.geometryType === 'esriGeometryMultipoint' || featureset.geometryType === 'esriGeometryPolyline') { renderer.symbol.setColor(new esri.Color([0, 255, 255, 1])); } else if (featureset.geometryType === 'esriGeometryPolygon') { renderer.symbol.setColor(new esri.Color([0, 255, 255, 0.25])); } debugger; var features = []; var incomeData = getIncomeResult[1].split(","); var panfromWS = getIncomeResult[0].split(","); for (var i = 0; i < len; i++) { panidFeature = "'" + featureset.features.attributes.pan_id + "'" ; for (var j = 0; j < len; j++) { if (panidFeature == panfromWS ) { attributeObj = new Object(); attributeObj.objectid = featureset.features.attributes.FID; attributeObj.name = "ssssssss"; attributeObj.address = "address"; attributeObj.pan_id = featureset.features.attributes.pan_id; attributeObj.Income = incomeData ; longi = featureset.features.geometry.x; lat = featureset.features.geometry.y; pt = new Point(longi,lat,this.map.spatialReference); feature = new Object(); feature.attributes = attributeObj feature.geometry = pt; features.push(feature); //break; } } } jsonFS.features = features; var featureSet = new FeatureSet(jsonFS); featureSet.spatialReference = featureset.spatialReference; var infoTemplate = new InfoTemplate("${name}","NAME :${name}<br>ADDRESS :${address}<br>PAN_ID :${pan_id}<br>INCOME:${Income} Lakhs per annum"); var hsFeatureCollection = { layerDefinition:{ "displayFieldName": "", "geometryType": "esriGeometryPoint", "spatialReference": { "latestWkid": 3857, "wkid": 102100 }, "fields":[ { "name": "objectid", "type": "esriFieldTypeOID", "alias": "objectid" }, { "name": "name", "type": "esriFieldTypeString", "alias": "name", "length" : 50 }, { "name": "address", "type": "esriFieldTypeString", "alias": "address", "length" : 50 }, { "name": "pan_id", "type": "esriFieldTypeString", "alias": "pan_id", "length" : 255 }, { "name": "Income", "type": "esriFieldTypeInteger", "alias": "Income" }, { "name": "shape", "type": "esriFieldTypeGeometry", "alias": "shape" }, ], }, featureSet: featureSet, "exceededTransferLimit": false }; debugger; var heatmapFeatureLayerOptions = { mode: FeatureLayer.MODE_SNAPSHOT, outFields: ["*"], infoTemplate: infoTemplate, id:"Income Heatmap" }; heatMapInPutLyr = new FeatureLayer(hsFeatureCollection,heatmapFeatureLayerOptions); var extent = graphicsUtils.graphicsExtent(featureSet.features); this.map.setExtent(extent.expand(1.2)); heatMapInPutLyr.setDefinitionExpression("Income = 50000"); this.map.addLayer(heatMapInPutLyr); } Thanks, Mohan
... View more
09-27-2017
10:04 PM
|
0
|
5
|
727
|
POST
|
Hi, I have created custom feature layer (polygon) , and able to add it in to the map . Now i am trying to show only few geometries , so i am using setDefinition expression but it is not working . Its shows all the features on the Map. Will this method work in custom feature layer ?
... View more
09-27-2017
12:59 AM
|
0
|
7
|
1147
|
POST
|
AutomationException: 0x5 - Access is denied. in 'Invoke' . Getting error on this line AoInitialize aoInit = new AoInitialize(); I downloaded the SDK for Java 10.5 (ArcGIS Desktop Version ) from my.esri.com and installed the software . Added the libraries in eclipse . I am trying to initialize the license using AoInitialize object but I got the error in the first line of the code itself (AoInitialize aoInit = new AoInitialize()) java version "1.8.0_131" Java(TM) SE Runtime Environment (build 1.8.0_131-b11) ArcGIS version is 10.5
... View more
09-11-2017
10:22 PM
|
0
|
0
|
748
|
Title | Kudos | Posted |
---|---|---|
1 | 11-30-2016 12:41 AM |
Online Status |
Offline
|
Date Last Visited |
2 weeks ago
|