POST
|
I have the same problem, but I couldn't find the right way to whitelist a domain. Can you please explain the steps of whitelisting the required domains?
... View more
09-19-2016
10:59 PM
|
0
|
1
|
973
|
POST
|
I modified the code to remove any scale restriction, but this didn't fix the issue: var view = new MapView({
container: "viewDiv",
map: map,
constraints: {
minScale: 0,
maxScale: 0
}
});
... View more
06-21-2016
04:53 AM
|
0
|
0
|
303
|
POST
|
I am facing a strange behavior using Java script API 4.0. I have two layers to display, one is a tile layer and the other one is a feature layer. When I add the tile layer at the bottom, then I can't zoom in to all levels, but when I add the tile layer at the top every thing goes well but of curse the feature layer will not be visible. Below is the code that cause the problem: var MyFeatureLayer = new FeatureLayer({ url: "http://*******/MapServer" }); var MyTileLayer = new TileLayer({ url: "http://*******/MapServer" });
var map = new Map({
layers: [MyTileLayer, MyFeatureLayer]
});
If I changes the order when adding the layers it works, but the tile layer will hide the feature layer: var map = new Map({
layers: [MyFeatureLayer, MyTileLayer]
});
Any Idea?
... View more
06-20-2016
04:32 AM
|
0
|
2
|
2498
|
POST
|
Dear FC Basson, Thank you very much for your help. I tried your nice last fiddle and found that on some clicks the result is as expected, and on others it is not. I hope that esri's java script API team to look at this issue and fix it.
... View more
06-08-2016
12:49 AM
|
0
|
1
|
492
|
POST
|
Thank you. But still not workingfor me. It works only if I clicked the button while the buildings are being loaded. But if I click the button after all buildings are completed loding then all buildings disappears.
... View more
06-07-2016
05:36 AM
|
0
|
1
|
492
|
POST
|
Here is the fiddle with your advised code. Still not working for me: Edit fiddle - JSFiddle
... View more
06-07-2016
05:33 AM
|
0
|
1
|
938
|
POST
|
Dears, I made a fiddle to simulate the problem: Edit fiddle - JSFiddle Run the page and wait until the buildings are added to the map, then click on "ChangeExpression" button. The expected result is that only buildings higher then 30will be visible. The actual result is that all buildings are disappearing.
... View more
06-07-2016
05:24 AM
|
0
|
3
|
938
|
POST
|
To simulate my case, you may check the following example: ArcGIS API for JavaScript Sandbox And use the following updated code, then after clicking the button on the top of the map, the building's layer is disappearing: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no"> <title>Extrude building footprints based on real world heights - 4.0</title> <link rel="stylesheet" href="https://js.arcgis.com/4.0/esri/css/main.css"> <script src="https://js.arcgis.com/4.0/"></script> <style> html, body, #viewDiv { padding: 0; margin: 0; height: 100%; width: 100%; } </style> <script> require([ "esri/Map", "esri/views/SceneView", "esri/layers/FeatureLayer", "esri/renderers/UniqueValueRenderer", "esri/symbols/ExtrudeSymbol3DLayer", "esri/symbols/PolygonSymbol3D", "dojo/on", "dojo/domReady!" ], function( Map, SceneView, FeatureLayer, UniqueValueRenderer, ExtrudeSymbol3DLayer, PolygonSymbol3D, on ) { /***************************************************************** * Define symbols for each unique type of building. One each for * residential, condos, and other. *****************************************************************/ var resSym = new PolygonSymbol3D({ symbolLayers: [ new ExtrudeSymbol3DLayer({ material: { color: "#FC921F" } }) ] }); var condoSym = new PolygonSymbol3D({ symbolLayers: [ new ExtrudeSymbol3DLayer({ material: { color: "#9E559C" } }) ] }); /***************************************************************** * Set each unique value directly in the renderer's constructor. * At least one field must be used (in this case the "DESCLU" field). * The label property of each unique value will be used to indicate * the field value and symbol in the legend. * * The size visual variable sets the height of each building as it * exists in the real world according to the "ELEVATION" field. *****************************************************************/ var renderer = new UniqueValueRenderer({ defaultSymbol: new PolygonSymbol3D({ symbolLayers: [new ExtrudeSymbol3DLayer({ material: { color: "#A7C636" } })] }), defaultLabel: "Other", field: "DESCLU", visualVariables: [{ type: "size", field: "ELEVATION", valueUnit: "feet" // Converts and extrudes all data values in feet }] }); // Set the renderer on the layer var buildingsLyr = new FeatureLayer({ url: "https://services1.arcgis.com/jjVcwHv9AQEq3DH3/ArcGIS/rest/services/Buildings/FeatureServer/0", renderer: renderer, popupTemplate: { title: "{DESCLU}", content: "{*}" }, outFields: ["ADDRESS", "DESCLU", "ELEVATION"], definitionExpression: "ELEVATION > 0", // show only buildings with height }); var map = new Map({ basemap: "streets", ground: "world-elevation", layers: [buildingsLyr] }); var view = new SceneView({ container: "viewDiv", map: map, camera: { position: { x: -8354148, y: 4641966, z: 129, spatialReference: { wkid: 3857 } }, heading: 300, tilt: 75 } }); on(document.getElementById("ChangeExpression"), "click", function (e) { buildingsLyr.definitionExpression = "ELEVATION > 30" //alert(buildingsLyr.definitionExpression); }); }); </script> </head> <body> <button id="ChangeExpression">ChangeExpression</button> <div id="viewDiv"></div> </body> </html>
... View more
06-07-2016
03:59 AM
|
0
|
0
|
938
|
POST
|
This is what I am doing, but the layer is disappearing after I change definitionExpression
... View more
06-07-2016
03:24 AM
|
0
|
0
|
938
|
POST
|
definitionExpression attribute of FeatureLayer works fine when the application is loaded, but when I click a button that changes the definitionExpression attribute of the layer, the displayed features disappear from the map but I don't see the new features based on the new definitionExpression, although the attribute is changed. The code I am using: var buildingsLyr = new FeatureLayer({ url: "myURL", id: "BuildingsBM", renderer: renderer, popupTemplate: { title: "{ID}", content: "{*}" }, outFields: ["ID", "Use", "Z"], definitionExpression: "Sector = 'S1'", // show only buildings within this sector }); map = new Map({ basemap: "streets", layers: [buildingsLyr] }); view = new SceneView({ container: "viewDiv", map: map , camera: { position: [54, 24, 30000], heading: 0, tilt: 35 } }); // on button click, change the definitionExpression on(document.getElementById("btnLocate"), "click", function (e) { buildingsLyr.definitionExpression = "Sector = 'S2'" });
... View more
06-07-2016
01:41 AM
|
0
|
15
|
4304
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|