|
DOC
|
Chris, In the widget.js, I have a .toFixed(1) method which sets the decimal places to 1 for display on the measurements. This occurs on several lines in the code. You can simply do a search in your editor for ".toFixed(1)" and this will find the lines you need to modify. Change the 1 to a 2 or 3. I would caution you that depending on the measurement units (miles, feet) that you may be overstating the accuracy of the measurement. Regards, Tom
... View more
01-09-2018
01:17 PM
|
0
|
0
|
9293
|
|
POST
|
Jay, I have done this a few different ways. The first I create a context menu of the clicked location with one of the selections being adding the point to your directions. The second uses a button to click that adds the location to driving directions. The third method uses the current vehicle position and a call location. Both locations are added as stops and driving directions are calculated. Here is the code I used: // context menu
function createMapMenu() {
// Creates right-click context menu for map
mapMenu = new Menu({
onOpen: function(box) {
// Lets calculate the map coordinates where user right clicked.
// We'll use this to create the graphic when the user clicks
// on the menu item to "Add Point"
menuLocation = getMapPointFromMenuPosition(box);
}
});
mapMenu.addChild(new MenuItem({label: "Copy lat,lon to Clipboard", onClick: copyCoordinates}));
mapMenu.addChild(new MenuSeparator());
mapMenu.addChild(new MenuItem({label: "Copy Address to Clipboard", onClick: copyAddress}));
mapMenu.addChild(new MenuSeparator());
mapMenu.addChild(new MenuItem({label: "Display Street View", onClick: displayMenuStreetView}));
mapMenu.addChild(new MenuSeparator());
mapMenu.addChild(new MenuItem({label: "Add Driving Directions Stop", onClick: addDrivingDirectionsStop}));
mapMenu.addChild(new MenuSeparator());
mapMenu.addChild(new MenuItem({label: "Identify Features", onClick: menuIdentify}));
mapMenu.addChild(new MenuSeparator());
mapMenu.addChild(new MenuItem({label: "Find Prefire Plans", onClick: menuFindPrefirePlans}));
mapMenu.startup();
mapMenu.bindDomNode(map.container);
}
function addDrivingDirectionsStop() {
reverseLocator.locationToAddress(menuLocation, 200, addAddressedStop);
}
function addAddressedStop(e) {
var mstop = {name: e.address.Address, feature: {geometry: {x: menuLocation.x, y: menuLocation.y, spatialReference: {wkid: 102100}}, attributes: {info: "stop"}}};
directions.addStop(mstop);
}
// button with xy data directions
function directionsButton() {
$("#btnUnitDirections" + unitText).data('btnUnitDirections'+unitText, {pt: unitPoint, info: "Vehicle: " + unitText});
$("#btnUnitDirections" + unitText).on('click', updateDirectionsLocation);
}
function updateDirectionsLocation(evt) {
var id = evt.currentTarget.id;
var data = $("#" + id).data(id);
var latLng = data.pt;
var pt = webMercatorUtils.geographicToWebMercator(latLng);
var info = data.info;
var stopObject = {name: info, feature: {geometry: {x: pt.x, y: pt.y, spatialReference: {wkid: 102100}}, attributes: {info: info}}};
directions.addStop(stopObject);
}
function callDrivingDirections() {
// create driving directions from the unit to the call
// create the vehicle stop
var vPt = webMercatorUtils.geographicToWebMercator(myUnitPoint);
var vstop = {name: "Current Vehicle Location...", feature: {geometry: {x: vPt.x, y: vPt.y, spatialReference: {wkid: 102100}}, attributes: {info: myUnitInfo}}};
directions.addStop(vstop);
// create the call stop
var cPt = webMercatorUtils.geographicToWebMercator(myCallPoint);
var cstop = {name: myCallInformation, feature: {geometry: {x: cPt.x, y: cPt.y, spatialReference: {wkid: 102100}}, attributes: {info: myCallInformation}}};
directions.addStop(cstop);
directions.zoomToFullRoute();
} I hope this is helpful! Regards, Tom
... View more
01-05-2018
11:40 AM
|
1
|
0
|
1232
|
|
DOC
|
Jacqueline, Yes! The measure widget uses the JIMU drawbox dijit, which in turn uses the draw toolbar. A quick way to suppress tooltips is to add one line of code in the postCreate function at around line 132. this.drawBox.drawToolBar._options.showTooltips = false; This will disable all tooltips for the draw toolbar. best regards, Tom
... View more
12-14-2017
12:26 PM
|
2
|
0
|
9293
|
|
DOC
|
Hunter, The export was written so the traverse could be imported into ArcGIS if need be. In their specification, there is no allowance for the rotation angle. Here is the link to the document I used: Traverse file format—Help | ArcGIS for Desktop Regards, Tom
... View more
12-13-2017
09:26 AM
|
0
|
0
|
11424
|
|
DOC
|
Greetings Pavel, Apologies. I haven't forgotten about your request. I will get to it. I am behind on some other projects at present. Regards, Tom
... View more
09-11-2017
10:07 AM
|
0
|
0
|
9293
|
|
DOC
|
Kevin, Thanks very much for your kind words. I appreciate it. The nice part about snapping in the measure and draw widget is that it is available out of the box. I didn't need to add any logic to the measure widget for it to be able to do snapping. It is part of the draw toolbar used by the widgets. I use dynamic layers on a lot of my features too as it does take longer to draw a feature layer. It is all the vectors and the associated data. Time is our friend. I am betting that ESRI will start making more use of the protocol buffers that are used in vector tiles to work with feature layers, which will make the messages much smaller than JSON. If/when that happens, we will be using a lot more featurelayers. Regards, Tom
... View more
08-28-2017
02:32 PM
|
1
|
0
|
9293
|
|
DOC
|
Kevin, Snapping is already available. It will only snap to feature server layer though. Feature server layers are drawn using vectors rather than just an image representation as in a map server layer. You just need to hold down the control (CTRL) key and hover over the desired feature. It will snap to an edge or to a vertex. If within tolerance it will favor the vertex. Regards, Tom
... View more
08-25-2017
01:20 PM
|
1
|
0
|
9293
|
|
DOC
|
Pavel, I can certainly add this functionality. To be clear, are you wanting an angle offset? Do you need to add an additional 7 degrees to each angle? Regards, Tom
... View more
08-24-2017
08:56 AM
|
0
|
0
|
9293
|
|
DOC
|
Eric, Thanks! This will do the trick. I am a bit behind on some other priority projects, so I haven't even looked at my geonet queue for a bit. Regards, Tom
... View more
08-24-2017
08:51 AM
|
0
|
0
|
9293
|
|
DOC
|
Pavel, Can you please provide more information? I would need to know how you calculate a bearing. Do you have an example of the result you are expecting? Thanks very much! Regards, Tom
... View more
08-14-2017
11:26 AM
|
0
|
0
|
9293
|
|
DOC
|
Gerald, Glad that worked for you! You can absolutely edit the graphics. Just click the drawn graphic and it will expose handles at each vertex and provide ghost vertices that will allow you to split the lines. The measures automatically recalculate as you move the vertex handle. You can only edit line, polyline and polygon geometries. Regards, Tom
... View more
08-01-2017
11:18 AM
|
0
|
0
|
9293
|
|
DOC
|
Gerald, Here you go: this.textSymChooser.textColor.domNode.style.backgroundColor = "white"; Regards, Tom
... View more
07-28-2017
03:59 PM
|
0
|
0
|
9293
|
|
DOC
|
Gerald, Ah... Sorry, I will investigate. Regards, Tom
... View more
07-28-2017
11:21 AM
|
0
|
0
|
9293
|
|
DOC
|
Gerald, This code will change the text preview color to white: html.setStyle(this.textSymChooser.textPreview, {
color: "white",
fontSize: 20
}); Regards, Tom
... View more
07-28-2017
10:02 AM
|
0
|
0
|
9293
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-19-2023 08:13 AM | |
| 1 | 02-22-2023 09:12 AM | |
| 1 | 05-15-2015 03:11 PM | |
| 1 | 02-10-2015 11:52 AM | |
| 1 | 01-19-2017 02:01 PM |
| Online Status |
Offline
|
| Date Last Visited |
02-26-2024
04:50 PM
|