|
POST
|
Your elevation layer does seem to be private, but searching for that error in the source code tells me that it gets thrown when: elevationLayer.tileInfo.spatialReference !== view.spatialReference Looking at the BaseElevationLayer class, it seems that the spatial reference is always set to web mercator for the layer and for the tileInfo property. I don't know why this is (I think it's just an assumption they made, that users are mainly going to create BaseElevationLayers to use the Esri world elevation layer, which is in web mercator), but you might try manually setting the SRs in the load function: var ExaggeratedElevationLayer = BaseElevationLayer.createSubclass({
...,
load: function() {
const customSR = new SpatialReference({ wkid: 31463 });
this._elevation = new ElevationLayer({
spatialReference: customSR,
url: "http://rips-rasterdaten.lubw.bwl.de/arcgis/rest/services/Imageservices/DGM025_cache_3D/ImageServer"
});
// wait for the elevation layer to load before resolving load()
this.spatialReference = customSR;
this.tileInfo.spatialReference = customSR;
this._elevation.tileInfo.spatialReference = customSR;
this.addResolvingPromise(this._elevation.load());
},
...
}); This may not be enough, you may need to set the entire tileInfo object on this._elevation and/or on the base elevation layer itself. Assuming the elevation layer works when it's not exaggerated, you may be able to copy tileInfo from the normal layer and hardcode it in the load function. There's probably an easier way to do this by modifying the constructor but you may be able to get this to work.
... View more
09-27-2017
07:41 AM
|
1
|
2
|
2602
|
|
POST
|
Here's a sample that does this: JS Bin - Collaborative JavaScript Debugging Only works on point graphics. Graphics will other geometries will be more involved but also possible with a little work.
... View more
09-26-2017
08:25 AM
|
1
|
0
|
2327
|
|
POST
|
I believe you can query attachments using this REST endpoint: ArcGIS REST API I don't think the JS API has a wrapper around that, but you can send requests to that route using esri/Request.
... View more
09-25-2017
06:14 AM
|
0
|
0
|
1720
|
|
POST
|
The basemaps load fine for me using both versions of the API. The example you link is fluid for me You say that in 3.XX, tiles are loading quickly enough for you but in 4.XX they are not. The two versions use the same services for the basemaps, so this shouldn't really be a problem. One troubleshooting option would be to open up the network tab in dev tools and see how long it's taking for tiles to get from the server to the client. You can do this for both API versions to see if there's a significant difference (there shouldn't be). My guess is that there's a browser issue of some kind here. Which browser/version are you using? Another possibility is that your connection to the map servers is intermittently poor and you've only noticed it while working with the 4.XX API.
... View more
09-24-2017
11:54 AM
|
0
|
1
|
1416
|
|
POST
|
Yes, this is a bug. You can solve it by adding something like this: // where layer is your FeatureLayer
layer.createQuery = function(){
let q = layer.__proto__.createQuery.call(layer);
q.outFields = null;
q.where = null;
return q;
} You'd have to do this for each feature layer you create that you want to behave like this. A better solution would probably be to create a subclass that inherits from FeatureLayer and fix this method there and then use that class instead of FeatureLayer, like this: var FL2 = FeatureLayer.createSubclass([], {
createQuery: function(){
var q = this.inherited(arguments);
q.outFields = null;
q.where = null;
return q;
}
});
var layer = new FL2({...}); Keep in mind that you're changing how createQuery behaves and that may screw something else up, although it's probably safe to do for client-side feature layers.
... View more
09-22-2017
12:58 PM
|
0
|
2
|
2260
|
|
POST
|
There's no high level tool to do this, but you can use the geometry engine to work something out. If a road in this case is a polyline, you can find the distance between the road and the point, and if the distance is less than some number, move the point onto the polyline. Here's a simple example showing this: JS Bin - Collaborative JavaScript Debugging (mouse over the view around the line to see the snapping effect) A few things to note: I recommend doing all of this in the web mercator spatial reference. Whichever spatial reference you use needs to match, that is the polyline's sr must match the point's sr. In the example, I set the "snap distance" to 10 pixels. If you want to snap based on world-meter-distance, you could take out the pixel logic and use meters instead.
... View more
09-21-2017
08:35 AM
|
0
|
0
|
2876
|
|
POST
|
There's a few errors in your code, mainly that labelPoints wants an array of polygon geometries, not an array of graphics, and you should also use .then after you call .labelPoints, like this: JS Bin - Collaborative JavaScript Debugging You also need to pull in Font and Color if you're going to use those modules. But you generally don't need to pull that stuff in as the 4.XX API introduces autocasting. Even after I fixed those issues, the callback passed in to labelPoints is not getting called. My feeling is that there's some minor issue that I'm overlooking: some of the code behind the GeometryService requests is a little finicky and has some inconsistencies with the rest of the codebase. I'll take a look tomorrow and see if I can find the exact place it's failing. I would suggest that you could get away with using the centroid of each polygon to place labels. This won't be perfect (and presumably findLabels does a better a job) but you should usually be able to use the centroid, or even the center of the extent: JS Bin - Collaborative JavaScript Debugging
... View more
09-20-2017
02:07 PM
|
1
|
0
|
1365
|
|
POST
|
I'm not completely sure how that stuff is implemented but when possible, I would guess it's better to do a pixel intersection check rather than a geometry intersection check, so that may be what gets done. It is possible to generate a geometry based on a text symbol at a given zoom, but it might take some work and there's probably a better way to approach this.
... View more
09-20-2017
06:02 AM
|
0
|
0
|
1387
|
|
POST
|
Looks like the problem is with concat. Try changing this line: lyr.source = lyr.source.concat(features); to this: features.forEach(f => lyr.source.push(f)); As far as doing the projections locally, I'm sure it's possible, it's just a question of finding the right code. You might want to look at some open source tools for this kind of thing, like proj4. There also may be some way to interface with Esri software with python, which would allow you to set up a local web server and use that to feed projections to the browser.
... View more
09-18-2017
06:58 AM
|
0
|
0
|
3622
|
|
POST
|
You'll need an internet connection to use the geometry service. You can do this from JS normally, I just meant that most esri services have an HTML UI but the geometry service I linked doesn't. Here's a sample showing how to project a list of geometries (only one in the example) and then add each one to a layer as a new graphic: JS Bin - Collaborative JavaScript Debugging
... View more
09-15-2017
09:48 AM
|
1
|
3
|
3622
|
|
POST
|
You can't really describe the exact geometry of a text symbol in terms of map units as this number will change as you zoom in and out. You could describe it in pixels. In general, text symbols are set on point geometries. So the user just describes the center of the text symbol and not the area it takes up.
... View more
09-15-2017
06:06 AM
|
1
|
2
|
1387
|
|
POST
|
To go a little further, the only projection that is included in the JS API is WGS84 to web mercator and web mercator to WGS84. Everything else is done on the backend. There is a public geometry service that you can use located at https://utility.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer (only supports json, no html)
... View more
09-15-2017
06:02 AM
|
1
|
5
|
3622
|
|
POST
|
The geometry service is unchanged, so you can use it to get buffers into 4.4, just like in 3.2. You can also do a client side buffer using the geometryEngine or geometryEngineAsync. Geometry Service buffer There's no draw tool in 4.4, but simple draw tools are coming in 4.5, which should be released before the end of the month.
... View more
09-13-2017
01:44 PM
|
1
|
0
|
1220
|
|
POST
|
As far as I know there's only one definition expression so the way to handle this is to create and maintain a single definition expression. I would guess that you should be appending the second definition expression to the first, separated by an AND. As your needs get more complicated, sometimes it makes sense to write code that keeps track of your definition expression in some other format (say, an array of strings or a Set) and every time that variable is modified, you'll recalculate your entire definition expression. This lets you add and remove clauses in your defintion expression easily.
... View more
09-13-2017
07:42 AM
|
0
|
0
|
1003
|
|
POST
|
Cool, looks great. I've been meaning to continue looking into why the polygons are being drawn incorrectly here. My understanding is that the rings need to be wound clockwise to be filled (holes are counter clockwise), and in situations like this you can view a ring "from above" to determine its winding. That means the winding needs to be different depending on which direction the "bottom half" is offset from the "top half." Hope to get a chance to keep playing with this at some point.
... View more
09-12-2017
07:04 AM
|
1
|
0
|
2755
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-03-2017 08:23 AM | |
| 1 | 11-02-2017 08:36 AM | |
| 1 | 11-02-2017 09:23 AM | |
| 1 | 09-20-2017 02:07 PM | |
| 1 | 10-06-2017 05:54 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:24 AM
|