|
DOC
|
11/14/2017 - Tested with WAB 2.5. Updated default linesymbol drawing to a solid line as export/import as GeoJSON had issues with a short dash line. 07/05/2017 - Fixed problem with CSS that was interfering with the attribute table display. Also added the ability to toggle the infowindow/popup display, some users want to be able to click on control points or other geometry and get more information. 12/07/2016 - Changed timeout on warning from 3 seconds to 6 seconds 12/06/2016 - Added warning to user when changing distance unit type or angle type when the traverse has courses Popups were disabled to prevent display when drawing courses Default values were added to the settings for DD or DMS, Quadrant or Azimuth, Distance Units and Area Units Logic was added to allow the user to key in a file name when saving a traverse, GeoJSON or a report 12/02/2016 - Fixed problem that was preventing widget use in projections other than Web Mercator The traverse widget allows you to create, edit and save a geographic shape based on bearing and distance measurements. Course degrees can be entered in decimal degrees or degree minute second formats. Course angles can be quadrants or north azimuth angles. Course distances can be in a variety of units. The traverse can be rotated around the start point. Traverse areas and closures will always be calculated. Once created the traverse can be saved a GeoJSON shape or saved in a structure compatible with ArcMap CoGo or ParcelFabric. Saved traverse files can be loaded and used at a later time. A demo of the traverse widget can be found here: Traverse Demo A sample traverse text file you can use with the demo can be found here: Sample Traverse File A help document explaining the use of the traverse widget can be found here: Help! The creation of this widget was a collaboration between myself an Dean Anderson from Polk County, Oregon.
... View more
12-01-2016
11:41 AM
|
11
|
44
|
19523
|
|
POST
|
John, Brilliant! This was exactly what was missing. The file uploaded quickly and was resized as expected. I did use dojo domConstruct instead of put. Here is the code that I used: var formNode = domConstruct.create("form",{"method":"post","enctype":"multipart/form-data"});
var formData = new FormData(formNode);
formData.append("file",imageResized,filename);
Thanks very much! A great way to end my day! Regards, Tom
... View more
11-15-2016
04:29 PM
|
0
|
0
|
623
|
|
POST
|
John, Do you have an example of how you pass a html <form> node in a FormData object? Regards, Tom
... View more
11-15-2016
02:21 PM
|
0
|
0
|
4532
|
|
POST
|
Robert, I am using the Chrome debugger and I can definitely see that the variable is loaded before I hit the upload button. The resize takes less than a second on a 4M image. Thanks very much! Regards, Tom
... View more
11-15-2016
01:51 PM
|
0
|
0
|
4530
|
|
POST
|
Robert, I am able to draw the resized image back on the screen with the imageDataUrl variable, but I don't really have a way to know for sure if the BLOB that is created in the imageResized variable is valid. I would think that a BLOB is a BLOB and either way I should be able to send it to the server. Regards, Tom
... View more
11-15-2016
01:30 PM
|
0
|
2
|
4532
|
|
POST
|
Robert, Thanks very much for the quick reply. Here is the code that I am using to reduce the image size: var imageResized, imageDataUrl;
var dataURLToBlob = function(dataURL) {
var BASE64_MARKER = ';base64,';
if (dataURL.indexOf(BASE64_MARKER) == -1) {
var parts = dataURL.split(',');
var contentType = parts[0].split(':')[1];
var raw = parts[1];
return new Blob([raw], {type: contentType});
}
var parts = dataURL.split(BASE64_MARKER);
var contentType = parts[0].split(':')[1];
var raw = window.atob(parts[1]);
var rawLength = raw.length;
var uInt8Array = new Uint8Array(rawLength);
for (var i = 0; i < rawLength; ++i) {
uInt8Array[i] = raw.charCodeAt(i);
}
return new Blob([uInt8Array], {type: "image/jpg"});
//return new Blob([uInt8Array], {type: contentType});
}
on(dom.byId("submitRequest"), "click", sendContent);
on(dom.byId('aPhoto'), 'change', function(evt) {
// Read in file
var file = evt.target.files[0];
// Ensure it's an image
if(file.type.match(/image.*/)) {
console.log('An image has been loaded');
// Load the image
var reader = new FileReader();
reader.onload = function (readerEvent) {
var image = new Image();
image.onload = function (imageEvent) {
// Resize the image
var canvas = document.createElement('canvas'),
max_size = 800,
width = image.width,
height = image.height;
if (width > height) {
if (width > max_size) {
height *= max_size / width;
width = max_size;
}
} else {
if (height > max_size) {
width *= max_size / height;
height = max_size;
}
}
canvas.width = width;
canvas.height = height;
canvas.getContext('2d').drawImage(image, 0, 0, width, height);
imageDataUrl = canvas.toDataURL('image/jpeg');
imageResized = dataURLToBlob(imageDataUrl);
};
image.src = readerEvent.target.result;
evt.target.files[0] = readerEvent.target.result;
};
reader.readAsDataURL(file);
}
}); Regards, Tom
... View more
11-15-2016
11:14 AM
|
0
|
4
|
4532
|
|
POST
|
Greetings, I have a mobile app that I have built using the JSAPI that allows the user to take a picture with their iPad and posts it to a geoprocessing upload service. This is working very well, but the image size is unnecessarily large. I have a couple of functions that reduce the image size and create a BLOB that I would like to post to the same geoprocessing upload service. I have tried many different variations of posting the file using the request module in the JSAPI with no luck. The request I make gives me a request succeeded message, but I can see in my ArcGIS Server logs that the request is actually failing (which is also odd...). The error message says "Error performing upload operation, File size or type not supported for this service". I am using the FormData which the documentation says will work, but I am obviously missing something. Here is a snippet of the code that I am using to post the reduced size image. var data = new FormData(); data.append('file', imageResized); var photoRequest = esriRequest({ url: url, form: data, content: { f: "json" }, handleAs: "blob", load: requestSucceeded, // callback error: requestFailed // on error }); I would appreciate any suggestions on what I am missing. Thanks very much! Regards, Tom
... View more
11-15-2016
10:57 AM
|
0
|
10
|
6549
|
|
DOC
|
Ah, if that is the case then I would prefer to keep it in context. It was created to measure geometries.
... View more
10-27-2016
04:00 PM
|
2
|
0
|
12384
|
|
DOC
|
Justin, I am not sure I understand your request. The measure widget was created to provide measurements of different geometry types. Are you wanting to measure text in some way? Or are you just wanting the measure widget to add additional text to the map? If you are wanting to add text to the map the draw tool is ideal for this purpose. Regards, Tom
... View more
10-27-2016
03:30 PM
|
0
|
0
|
12384
|
|
DOC
|
Ryan, Thanks very much! Glad you like it. You can override the default value by adding 2 lines of below line 124 in the measure Widget.js. It will look like this: this.textSymChooser.textPreview.innerHTML = "Sample Text"; // line 124 this.textSymChooser.textFontSize.value = 12; this.textSymChooser.textFontSize.textbox.value = "12"; Regards, Tom
... View more
10-27-2016
11:17 AM
|
0
|
0
|
12384
|
|
DOC
|
Brett, Thanks very much! Adding coordinates is probably doable, but will add another level of complexity. This is compounded even more when editing a measurement. It will also make the display very busy. The vertex coordinates would also have to be in same coordinate system as the basemap unless you added logic to project them. All of the measurements I am calculating is done at the client for speed. Projecting things at this point, would take a call to a geometry server and would slow things down. All that being said, I would start by adding a new graphicsLayer just for displaying coordinate information. It will make it easier to manage the coordinate graphics. Find the _measureClickSegment function. At the end of the if (gra) operation add logic to add the coordinate x and y information graphics. I serialize each graphic with this.editGraphicID, so I can properly associate all of the appropriate text with the graphic. You should set the same ID for each coordinate graphic too. The lastPoint variable, when populated will contain the x and y information of the coordinates. Your code would look something like this: var coordText = lastPoint.x + ", " + lastPoint.y var textSymbol = new TextSymbol(coordText, symbolFont, fontColor); textSymbol.setOffset(10,10); var att = {id: this.editGraphicID, index: 999}; var coordGraphic = new Graphic(lastPoint, textSymbol, att, null); this.coordinateLayer.add(lengthGraphic); This should be a good starting point for you to add coordinates to each segment you add to a polyline and polygon geometry. Regards, Tom
... View more
09-28-2016
11:59 AM
|
0
|
0
|
12384
|
|
DOC
|
Babatope, This was intentional. Those geometries are really complex and would be difficult to restrict the type of change made to them. Recalculating measurements would not work well. Here is an example: Regards, Tom
... View more
09-14-2016
08:45 AM
|
1
|
0
|
12384
|
|
DOC
|
Rich, The printing has been a problem. I don't have any control of how the printing process moves and changes the text. There is a screenshot widget https://community.esri.com/people/kmsagis/blog/2015/06/09/kevins-custom-wab-widgets that has been used to create usable images with the text in place. You might be able to try that and see if you get a better result. Regards, Tom
... View more
09-14-2016
08:37 AM
|
1
|
0
|
12384
|
|
DOC
|
Greetings all measure widget users! I have added functionality to the measure widget that will now allow you to show bearings for each drawn segment for polyline and polygon geometries. Thanks very much to Dean Anderson from Polk County, OR for the code snippet that allowed me to get this working. You can also edit the polyline or polygon graphic and the bearings will change accordingly. Regards, Tom
... View more
08-19-2016
03:25 PM
|
2
|
0
|
12384
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-24-2023 10:45 AM | |
| 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 |
| Online Status |
Offline
|
| Date Last Visited |
02-26-2024
04:50 PM
|