POST
|
I've added a map by setting the center and zoom on the mapView like so: var view = new MapView({
container: "viewDiv",
map: map,
zoom: 4,
center: [15, 65]
}); After the map loads, we need to determine the current bounds of the map so we can query our database for data within those extents. What is the best way to determine the current map extent after the map has loaded?
... View more
10-14-2016
01:45 PM
|
0
|
1
|
4658
|
POST
|
You can look at this post on suggestions to find the point on the polyline to show the popup at: What is the best way to find a point or midpoint for a highlighted polyline from the 'geometry' or 'feature' of the comp…
... View more
07-28-2016
04:11 PM
|
1
|
0
|
1093
|
POST
|
We were trying to solve the exact same problem in our project too. Unfortunately, we haven't found a solution yet for finding the location on the map to display the popup for the polyline (we would preferably want to display this at the midpoint of the line). However, we have been able to find a way to get the graphic to display for the selected polyline. We first clone the graphic for each of the search results when creating the list of the results. We use this saved graphic and display it on the graphics layer on the map when the user clicks the search result. Something like this: // Fires when the search() method is called and returns its results. searchWidget.viewModel.on("search-complete", function (evt) { if (evt.results && evt.results.length > 1) { // clone the graphic for each search result like so and save it somewhere: var savedGraphic= evt.results[0].results[0].feature.clone(); } });
... View more
07-22-2016
02:21 PM
|
0
|
1
|
1093
|
POST
|
I have found that if we add a Feature Layer to a map with visible property set to false like so, we cannot toggle the layer back on by just setting the visible property back to true: // If visible is false when adding the feature layer, cannot toggle the layer back on by clicking the button var featureLayer = new FeatureLayer({ url: "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Landscape_Trees/FeatureServer/0", visible: false }); map.add(featureLayer); However, if we set the visible property to true while adding the layer, the layer can be toggled on/off by setting visible property true/false. Here is a JS Fiddle showing visible property false when adding the layer (Here is the bug): JSFiddle Here is a JS Fiddle showing visible property true when adding the layer: JSFiddle Is there a workaround around this? Is the fix for this bug in the Esri backlog? Note: some other layers (eg: vector tile layers) do seem to work ok even though the visible property is false when adding the layer. I have seen this bug only in the feature layer so far.
... View more
07-13-2016
02:26 PM
|
1
|
2
|
2813
|
POST
|
I have the same problem too with Feature Layers. Because of this, feature layers with lots of features take really long to load. Also, the map seems to be very slow if it has a feature layer with lots of features.
... View more
07-12-2016
11:22 AM
|
0
|
1
|
428
|
POST
|
We have found this issue where if have multiple layers (including a vector layer) on the map and if we do the following, the current map extents are not applied to the vector layer: Disable vector tile layer (set visible property to false). Pan the map. Enable the vector tile layer. New map extents are not applied to the vector tile layer. Here is a JS fiddle where you can try this out: JSFiddle Is there a workaround/fix to this issue? As we require multiple layers that can be enabled/disabled on the map for our project, it is critical for our project that we get this working.
... View more
07-12-2016
08:48 AM
|
0
|
2
|
1267
|
POST
|
Yep, there are no mouse-over/mouse-out events for the view. I hope they add this functionality in soon.
... View more
05-20-2016
07:28 AM
|
3
|
0
|
1335
|
POST
|
In the ArcGIS JS API v 3.x there was a way to show popups on hovering over a feature: Feature layer hover | ArcGIS API for JavaScript Is it possible to do something similar using the v 4.0 API? Also, is there a way to run custom code on the onClick event of a feature on a layer? (We need to be able to display something other than a popup when a feature is clicked. Thanks!
... View more
05-16-2016
04:02 PM
|
2
|
6
|
8201
|
Title | Kudos | Posted |
---|---|---|
1 | 07-28-2016 04:11 PM | |
3 | 05-20-2016 07:28 AM | |
1 | 07-13-2016 02:26 PM | |
2 | 05-16-2016 04:02 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|