|
POST
|
Hi all, I am using JQuery drag function to allow users to drag their panels around. It works great but I am experiencing some issues when dragged out of the document to the right. It seems like it is causing a white margin to appear to the right of the window. Any idea? jsbin.
... View more
11-05-2015
10:57 AM
|
0
|
2
|
3195
|
|
POST
|
Hi all, Has anyone any idea how to activate and deactivate (toggle) identify task when a button is clicked? Here is some of jsbin I am fiddling with. I am taking as example this sample. Thanks, Alex
... View more
11-04-2015
01:11 PM
|
0
|
2
|
3097
|
|
POST
|
My code is here. An attempt to reproduce what I am trying to do is here ( I have only set the area but not length). Thanks, Alex
... View more
11-03-2015
10:05 AM
|
0
|
1
|
1736
|
|
POST
|
I tried but it still shows the value as "undefined"
... View more
11-03-2015
09:31 AM
|
0
|
4
|
1736
|
|
POST
|
Hi all, I am trying to get coordinates from a point drawn on a map. Just like this sample, I want users to have the choice of markers by letting them choose their markers using a drop down. The problem is that I can get the coordinates just fine when draw a point (by default) but when I switch marker I cant get the coordinates. Any idea why? 1) Get the coordinates for point drawn: var geometry = evt.geometry;
var symbol = dom.byId("symbol").value;
if (symbol) {
symbol = eval(symbol);
} else {
switch (geometry.type) {
case 'point':
symbol = tb.markerSymbol;
var mp = webMercatorUtils.webMercatorToGeographic(geometry);
dom.byId("coordinates").innerHTML = mp.x.toFixed(3) + ", " + mp.y.toFixed(3);
break; 2) UI drop down choice: <div class="form-group">
<select class="form-control" id="symbol">
<option value="">--- Symbol Options ---</option>
<option value="">--- Point ---</option>
<option value="new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_SQUARE, 7, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new color([255,0,0]), 1), new color([255,0,0,1]))">Default</option>
<option value="new SimpleMarkerSymbol().setColor(new color([0, 0, 255]))">Circle</option>
<option value="new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_DIAMOND, 20, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new color([0,0,0]), 1), new color([255,255,0,0.5]))">Diamond</option>
<option value="">--- Simple Line ---</option>
<option value="new SimpleLineSymbol()">Default</option>
<option value="new SimpleLineSymbol(SimpleLineSymbol.STYLE_DASH, new color([255,0,0]), 3)">Dash</option>
<option value="new SimpleLineSymbol(SimpleLineSymbol.STYLE_DOT, new color([255,0,0]), 5)">Dot</option>
<option value="">--- Cartographic Line Symbols ---</option>
<option value="new CartographicLineSymbol()">Default</option>
<option value="new CartographicLineSymbol(CartographicLineSymbol.STYLE_SOLID, new color([255,0,0]), 10, CartographicLineSymbol.CAP_ROUND, CartographicLineSymbol.JOIN_ROUND)">Solid, round cap, round join</option>
<option value="new CartographicLineSymbol(CartographicLineSymbol.STYLE_SOLID, new color([255,0,0]), 10, CartographicLineSymbol.CAP_SQUARE, CartographicLineSymbol.JOIN_BEVEL)">Solid, square cap, bevel join</option>
</select>
</div>
... View more
11-03-2015
09:18 AM
|
0
|
2
|
2692
|
|
POST
|
Hi all, I am trying to get a UI that allows users to select Measurement values from a drop down menu. I have some code that works great but I have to first manually select from drop down otherwise I get an "undefined" value. I would like that if nothing is selected in drop down by user then it automatically uses the first value in drop down. Any idea why? 1) This how I change selected values in my drop down: var areasUnits;
var areasUnitsText;
var LenghtUnits;
var LenghtUnitsText;
$('#Area').on('change', function () {
areasUnits = $(this).val();
areasUnitsText = $(this).find("option:selected").text();
alert(this.value)
});
$('#Length').on('change', function () {
LenghtUnits = $(this).val();
LenghtUnitsText = $(this).find("option:selected").text();
}); 2) This is my drop downs: <select id="Area" class="form-control">
<option value="UNIT_ACRES">Acres</option>
<option value="UNIT_SQUARE_MILES">Square Miles</option>
<option value="UNIT_ARES">Ares</option>
<option value="UNIT_HECTARES">hectares</option>
<option value="UNIT_SQUARE_FEET">Square Feet</option>
<option value="UNIT_SQUARE_KILOMETERS">Square Kilometers</option>
<option value="UNIT_SQUARE_METERS">Square Meters</option>
</select>
<div style=" width: 100%; border: solid; padding: 10px;"><span style="font-weight:bolder;">Results:</span> <span style="font-weight:bolder;" id="area"></span></div>
<br />
<p style=" font-style: italic; font-weight: bold; color:red;">Polylines</p>
<select id="Length" class="form-control">
<option value="UNIT_FOOT">Feet</option>
<option value="UNIT_KILOMETER">Kilometer</option>
<option value="UNIT_METER">Meter</option>
<option value="UNIT_STATUTE_MILE">Mile</option>
</select>
... View more
11-03-2015
09:05 AM
|
0
|
6
|
3936
|
|
POST
|
Robert, That is right I will differentiate between polygons and polylines later. I am testing on polygons for now. I tried your idea, I got "Invalid or missing input parameters.(…)" it seems like I need to "GeometryService.UNITNAME" to define the param correctly. Thanks, Alex
... View more
10-30-2015
02:14 PM
|
0
|
1
|
878
|
|
POST
|
Hi all, I am trying to create a drop down menu which would allow users to select the unit of their choice when measuring polygons and poly lines. Drop down is here: <select id="dropdown" class="selectpicker">
<option value="UNIT_SQUARE_MILES">Acres</option>
<option value="UNIT_ARES">Ares</option>
<option value="UNIT_HECTARES">hectares</option>
<option value="UNIT_SQUARE_FEET">Square Feet</option>
<option value="UNIT_SQUARE_KILOMETERS">Square Kilometers</option>
<option value="UNIT_SQUARE_METERS">Square Meters</option>
<option value="UNIT_SQUARE_MILES">Square Miles</option>
</select> Selected value: var areasUnits = $('option:selected', $('#dropdown')).val();
var geometry = evt.geometry;
var symbol = dom.byId("symbol").value;
if (symbol) {
symbol = eval(symbol);
} else {
switch (geometry.type) {
case 'point':
symbol = tb.markerSymbol;
break;
case 'polyline':
symbol = tb.lineSymbol;
var lengthParams = new LengthsParameters();
lengthParams.polylines = [geometry];
lengthParams.lengthUnit = GeometryService.UNIT_FOOT;
lengthParams.geodesic = true;
geometryServiceLength.lengths(lengthParams);
break;
case 'polygon':
symbol = tb.fillSymbol;
var areasAndLengthParams = new AreasAndLengthsParameters();
areasAndLengthParams.areaUnit = GeometryService.areasUnits;
areasAndLengthParams.calculationType = "geodesic";
geometryService.simplify([geometry], function (simplifiedGeometries) {
areasAndLengthParams.polygons = simplifiedGeometries;
geometryService.areasAndLengths(areasAndLengthParams);
});
break;
case 'freehandpolygon':
symbol = tb.fillSymbol;
var areasAndLengthParams = new AreasAndLengthsParameters();
areasAndLengthParams.areaUnit = GeometryService.UNIT_ACRES;
areasAndLengthParams.calculationType = "geodesic";
geometryService.simplify([geometry], function (simplifiedGeometries) {
areasAndLengthParams.polygons = simplifiedGeometries;
geometryService.areasAndLengths(areasAndLengthParams);
});
break;
default:
}
} Any ideas
... View more
10-30-2015
01:00 PM
|
0
|
4
|
2888
|
|
POST
|
Nevermind I found the issue.I dont really know how to delete but here was my solution: put the params in the switch...case. Thanks, Alex
... View more
10-29-2015
04:38 PM
|
1
|
0
|
1366
|
|
POST
|
Hi all, I am using this sample to get the measurements for my draw toolbar. It works great. However, I would like, in addition to this to measure polylines as AreaandLength only take polygons as input. To achieve this I am using esri/tasks/LengthsParameters. The combination of the two work but I keep getting this error: "Error: Unable to complete operation.(…)" altough it returns the right number. Any idea? Thanks, Alex var geometryService = new GeometryService("http://webgisdevint1/arcgis/rest/services/Utilities/Geometry/GeometryServer");
geometryService.on("areas-and-lengths-complete", outputAreaAndLength);
var geometryServiceLength = new GeometryService("http://webgisdevint1/arcgis/rest/services/Utilities/Geometry/GeometryServer");
geometryServiceLength.on("lengths-complete", outputLength);
//Get graphics to Graphic Layer dedicated for draw
function addGraphic(evt) {
map.graphics.clear();
var geometry = evt.geometry;
var symbol = dom.byId("symbol").value;
if (symbol) {
symbol = eval(symbol);
} else {
switch (geometry.type) {
case 'point':
symbol = tb.markerSymbol;
break;
case 'polyline':
symbol = tb.lineSymbol;
break;
case 'polygon':
symbol = tb.fillSymbol;
break;
case 'freehandpolygon':
symbol = tb.fillSymbol;
break;
default:
}
}
var areasAndLengthParams = new AreasAndLengthsParameters();
areasAndLengthParams.areaUnit = GeometryService.UNIT_ACRES;
areasAndLengthParams.calculationType = "geodesic";
geometryService.simplify([geometry], function (simplifiedGeometries) {
areasAndLengthParams.polygons = simplifiedGeometries;
geometryService.areasAndLengths(areasAndLengthParams);
});
var lengthParams = new LengthsParameters();
lengthParams.polylines = [geometry];
lengthParams.lengthUnit = GeometryService.UNIT_METER;
lengthParams.geodesic = true;
geometryServiceLength.lengths(lengthParams);
map.getLayer("drawGL").add(new Graphic(geometry, symbol));
}
function outputAreaAndLength(evtObj) {
var result = evtObj.result;
console.log(json.stringify(result));
dom.byId("area").innerHTML = result.areas[0].toFixed(3) + " acres";
}
function outputLength(evtObj) {
var result = evtObj.result;
console.log(json.stringify(result));
dom.byId("length").innerHTML = result.lengths[0].toFixed(3) + " feet";
}
... View more
10-29-2015
03:52 PM
|
0
|
3
|
3653
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-31-2016 11:46 AM | |
| 1 | 10-15-2014 02:17 PM | |
| 1 | 11-19-2015 09:14 AM | |
| 1 | 10-29-2015 04:38 PM | |
| 1 | 02-02-2015 09:55 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-05-2021
12:09 PM
|