DOC
|
Hey J W, I haven't been able to find gestureManager as an object of the View at 4.2. My guess is that Esri Inc. have wrapped this functionality up into the inputManager. At this stage, it looks like they are still changing the inputManager design (it has changed from 4.0, 4.1 to 4.2), hence the need to keep finding new ways to disable the map controls. I've only sat down looking at the inputManager at 4.2 for about 30 minutes or so, and the handlers seemed like the easiest way to control the map controls so far. If you think there is a better way, then submit some changes to the repo above with a pull request and I'll take a look (or someone from Esri Inc. might be able to provide some insights here!). Cheers, Jordan
... View more
02-22-2017
05:16 PM
|
0
|
0
|
4841
|
POST
|
Hey all, I've just noticed that if you rotate a MapView with an MapImageLayer on top, the MapImageLayer does not stay in sync with the views rotation. I.e. once you rotate off of 0 degrees, the MapImageLayer seems to rotate further each time and doesn't align with the view, util you go all the way back to 0 degrees. This can be tested using the Javascript MapImageLayer sample: MapImageLayer - Toggle sublayer visibility | ArcGIS API for JavaScript 4.2 Just rotate the map. Anyone else notice this? or have a workaround? Cheers, Jordan
... View more
02-21-2017
06:52 PM
|
0
|
2
|
1498
|
DOC
|
Hi All, I've updated the repo in the original post to work with the 4.2 API. Cheers, Jordan
... View more
02-19-2017
08:59 PM
|
1
|
0
|
4841
|
DOC
|
Hey, Just an update on this, I have noticed that you will get odd behaviour if using touch screens with the above properties. To get around it, you can use these instead: view.gestureManager.inputManager.gestures.drag.options.enable = false;
view.gestureManager.inputManager.gestures.altdrag.options.enable = false;
... View more
12-08-2016
02:42 PM
|
1
|
0
|
4841
|
POST
|
If you're happy to pay, Pluralsight offer heaps of online courses. I've previously had an account on there and done numerous courses in JavaScript, Python etc. They're all generally very well made and can cater to a varying range of skill levels.
... View more
11-30-2016
09:25 PM
|
2
|
0
|
1300
|
POST
|
It depends on what version of IE you're using. Vector tiles are only supported in IE11+. Vector tile layers—ArcGIS Online Help | ArcGIS Also, you should have a look in the developer console (F12) of your browser to see if you're getting any errors.
... View more
11-30-2016
09:21 PM
|
0
|
0
|
542
|
POST
|
Sounds like you actually want to launch a widget from the widget pool when the application starts, not just have an on-screen widget (e.g. Scalebar, Search)? As long as the widget has been added correctly to the config.json file, within the root folder of the application, and the actual widget exists within the widget folder, you might be able to call: PanelManager.getInstance().openPanel('widgetid')
You would need to call this somewhere after all the widgets have finished loading and also somewhere where the PanelManager is instantiated and available. Potentially somewhere within the init.js file after the loadResources() function has finished executing. Not sure exactly where, might take some trial and error.
... View more
11-17-2016
06:55 PM
|
0
|
0
|
592
|
POST
|
Hey Lloyd, Hmm, good question. I've never actually done that myself, used a Dynamic Map Service layer and manually set the labeling, however, having a look through the API, there is this property on the ArcGISDynamicMapServiceLayer: layerDrawingOptions If you have a look at the LayerDrawingOptions class, you'll see that it also has a labelingInfo parameter, which is of type LabelClass. Therefore, I'm wondering if you would be able to apply the LabelClass object you were creating to that. In the LabelClass page. there is a bit about the labelExpression and labelExpressionInfo which says you must use labelExpression if you're using an ArcGISDynamicMapServiceLayer. So from this, I'm guessing its possible! I had a bit of a play, but haven't been able to get the labels to appear on a Map Service layer yet. Hopefully someone else might be able to help out! Otherwise, I'll see if I can look at it again sometime.
... View more
11-16-2016
03:32 PM
|
0
|
0
|
851
|
POST
|
Hey Lloyd, There are a few things here. Firstly the LabelClass needs to be applied to a layer in your map, which will then render the layers labels in the way the LabelClass has specified. This snippet is taken directly from the LabelClass API reference in your link. //make sure the Map's showLabels option is set to true
var map = new Map("map",
{
basemap: "streets",
center:[-80, 30],
zoom: 5,
showLabels : true
});
//create featurelayer
var flayer = new FeatureLayer(url,
{
outFields: ["*"] //make sure field to label is specified here in outFields
});
//create a text symbol and renderer to define the style of labels
var labelSymbol = new TextSymbol();
var json = {
"labelExpressionInfo": {"value": "{LocalTime}"},
"useCodedValues": false,
"labelPlacement":"above-right",
"fieldInfos": [{fieldName: "LocalTime",format: { "dateFormat": "shortDate"}}]
};
//create instance of LabelClass
var lc = new LabelClass(json);
lc.symbol = labelSymbol; // symbol also can be set in LabelClass' json
flayer.setLabelingInfo([ lc ]); This is creating Feature Layer and then a TextSymbol. The TextSymbol is then applied as the symbol for the LabelClass and then the LabelClass is applied to the layer. I'm not sure from your example if you're doing this or not. Also, the labelClass.where is a where clause which is applied to the features in the layer as far as I'm aware, say for example you only want to show labels for features with an attribute > some value. It has nothing to do with the basemap. Secondly, to have the LabelClass change on basemap switch, a simple way to do this would be to define two seperate LabelClass definitions and then apply the correct one to the layer when needed. Or you can just use two TextSymbol definitions to change the colour of the label and apply that to the same LabelClass. Here's an example: var labelSymbol1 = new TextSymbol();
var labelSymbol2 = new TextSymbol();
labelSymbol2.setColor(new Color([128,0,0])).setAlign(Font.ALIGN_START).setAngle(45).setFont(
new Font("12pt").setWeight(Font.WEIGHT_BOLD)); Here we now have two TextSymbols, the second one has a different colour applied to it. Now, when the basemap switches, we can apply the correct Text to the labels by updating the layers label info: basemapToggle.on('toggle', function(sel) {
if (sel.currentBasemap == 'hybrid') {
symbol = labelSymbol2;
flayer.setLabelingInfo([ lc ]);
} else {
lc.symbol = labelSymbol1;
flayer.setLabelingInfo([ lc ]);
}
}); Hopefully this is what you're after. Putting all this together should result in you being able to change your labels based on the basemap changing.
... View more
11-14-2016
10:19 PM
|
1
|
2
|
851
|
DOC
|
Hey, View.gestureManager.inputManager.manager.options.enable = false That should disable all gestures on the Map View object. Then setting that same property to true, will enable it again. See how that goes. Cheers, Jordan
... View more
11-09-2016
02:45 PM
|
1
|
0
|
4841
|
POST
|
Hey, Has anyone else noticed this, and/or have a fix for it? If you set minZoom and maxZoom on your View object, like so: var view = new MapView({
container: "viewDiv",
map: map,
center: [15, 65],
constraints: {
minZoom: 5,
maxZoom: 19,
snapToZoom: true
}
});
Then when you reach the minZoom level (large scale) and continue to try to zoom further out, the map just randomly pans around as you scroll. When you reach the maxZoom level (small scale) and continue to zoom further in, then the zoom snaps back out to some other zoom level (mine is snapping back out to level 14). Does anyone have a strategy for handling this? Cheers, Jordan
... View more
11-01-2016
06:32 PM
|
0
|
0
|
1381
|
POST
|
Hi All, Just letting people know that I've built a Scalebar widget for the 4.x API. It blatantly uses some of the code from the Esri 3.17 Scalebar widget, so their existing widget did most of the legwork! The widget uses D3 to build the scalebar. GitHub - kingy68/esri-javascript-scalebar-4 Cheers, Jordan
... View more
09-26-2016
05:34 PM
|
1
|
0
|
1193
|
POST
|
Hey Bjorn, Any idea when this bug will be addressed: https://community.esri.com/thread/180774?q=lock ? Been mentioned a number of times. Alternatively, do you guys have any techniques we could use to curb this behaviour? Cheers, Jordan
... View more
09-25-2016
06:45 PM
|
0
|
0
|
490
|
POST
|
Hey All, Has anyone else noticed that the map-pan (mouse click-down) sometimes gets randomly locked down when panning/zooming the map? Zooming when it's locked seems to break the lock. It happens in the Esri sample maps too: Get started with MapView - Create a 2D map | ArcGIS API for JavaScript 4.0 Just randomly zoom and pan around in quick succession all over the map and eventually it should lock the pan down. Does anyone have a workaround to stop this from happening? Or is it a known bug? Cheers, Jordan
... View more
08-01-2016
08:46 PM
|
0
|
1
|
1006
|
POST
|
Not sure that there is really an easy way to do this. You could continue to do what you're already doing, but instead of snapping the popup box to the selectedResult.feature.geometry.extent.center, you could take that extent center, then pass it in to geometryEngine.nearestCoordinate() or geometryEngine.nearestVertex() to get the closest coordinate or vertex on the polyline. Then you snap the popup to the resulting geometry of the method. But, its still probably not going to get the center of the polyline, because the extent center for the polyline can be a long way away from the polyline depending on its shape. Here's a horrible example from MS Paint! If the red line is your polyline, then the extent of that polyline is essentially the box surrounding it. Therefore, the extent center would be the black dot, which is nowhere near the line. Another method could be to find the middle index for the polylines paths property and try snapping to that. But again, that is all dependent on the paths and if you have a straight line polyline with only two paths (start and end) then you will have no middle to snap too.
... View more
07-26-2016
04:58 PM
|
2
|
0
|
2084
|
Title | Kudos | Posted |
---|---|---|
1 | 07-09-2017 05:58 PM | |
1 | 11-14-2016 10:19 PM | |
1 | 07-13-2016 10:57 PM | |
1 | 02-28-2017 04:14 PM | |
1 | 07-06-2017 06:58 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|