|
POST
|
DUUHHH on me...lol...sorry for that stupid question...Thanks Robert
... View more
12-28-2017
05:57 AM
|
0
|
0
|
2245
|
|
POST
|
Think this works.....thoughts to make it read better? var layerInfo = arrayUtils.map(evt.layers, function (layer, index) {
if (layer.layer.id === "PastLocations") { return { }; } //Hides FSA aerial layer
if (layer.layer.id === "DGIFWMAs") { return { }; }
else { return { layer: layer.layer, title: layer.layer.name }; } //Else return as-is
});
... View more
12-27-2017
02:05 PM
|
0
|
2
|
2245
|
|
POST
|
What would proper syntax be to add more layers to this list? Need to do more than one...Thoughts? var layerInfo = arrayUtils.map(evt.layers, function (layer, index) {
if (layer.layer.id === "PastLocations") { return { }; } //Hides FSA aerial layer
else { return { layer: layer.layer, title: layer.layer.name }; } //Else return as-is
}); if (layer.layer.id === "PastLocations" OR layer.layer.id === "WMAs") { return { }; } if (layer.layer.id === "PastLocations") OR (layer.layer.id === "WMAs") { return { }; }
... View more
12-27-2017
02:03 PM
|
0
|
3
|
2245
|
|
POST
|
Fantastic....tweaked into my code map.on("layers-add-result", function (evt) {
map.on("mouse-move", showCoordinates);
map.on("mouse-drag", showCoordinates);
var layerInfo = arrayUtils.map(evt.layers, function (layer, index) {
if (layer.layer.id === "PastLocations") { return { }; } //Hides FSA aerial layer
else { return { layer: layer.layer, title: layer.layer.name }; } //Else return as-is
});
if (layerInfo.length > 0) {
var legendDijit = new Legend({
map: map,
layerInfos: layerInfo,
}, "legend");
legendDijit.startup();
}
});
... View more
12-27-2017
01:59 PM
|
0
|
4
|
2245
|
|
POST
|
I pretty much narrowed it down to this var marker = new SimpleMarkerSymbol().setPath("M14.5,29 23.5,0 14.5,9 5.5,0z").setAngle(180).setSize(20).setOutline(new SimpleLineSymbol().setColor("#ffffff").setWidth(2)); But I want to have an arrow that I can change the rotation angle on... I did this and everything worked including the legend. So eliminating the setPath etc. as seen above eliminated the error.... Anyone have any ideas on creating an Arrow other than my example above? var symbol = new SimpleMarkerSymbol({
"color": [255,255,255,64],
"size": 12,
"xoffset": 0,
"yoffset": 0,
"type": "esriSMS",
"style": "esriSMSCircle",
"outline": {
"color": [0,0,0,255],
"width": 1,
"type": "esriSLS",
"style": "esriSLSSolid"
}
});
var renderer = new SimpleRenderer(symbol);
renderer.setRotationInfo({
field: "HEAD",
rotationType: "arithmetic"
});
renderer.setColorInfo({
field: "SPEED",
minDataValue: 0,
maxDataValue: 85,
colors: [
new Color([255,0,0]), new Color([255,0,0]), new Color([34,139,34]), new Color([34,139,34]), new Color([34,139,34]), new Color([34,139,34]), new Color([34,139,34]), new Color([34,139,34])
]
});
CurrentLoc.setRenderer(renderer);
... View more
12-27-2017
11:56 AM
|
0
|
9
|
2619
|
|
POST
|
I am rendering a point Map Service with a SimpleMarkerSymbol and then a Renderer to set rotation and Color. This all works fine until I try and add this to a Legend. If I use the below code the Legend Fails. If I comment it out the and use a general point the Legend works fine. This causes the error: var marker = new SimpleMarkerSymbol().setPath("M14.5,29 23.5,0 14.5,9 5.5,0z").setAngle(180).setSize(20).setOutline(new SimpleLineSymbol().setColor("#ffffff").setWidth(2));
var renderer = new SimpleRenderer(marker);
renderer.setRotationInfo({
field: "HEAD",
rotationType: "arithmetic"
});
renderer.setColorInfo({
field: "SPEED",
minDataValue: 0,
maxDataValue: 150,
colors: [
new Color([255,0,0]), new Color([255,0,0]), new Color([34,139,34]), new Color([34,139,34]), new Color([34,139,34]), new Color([34,139,34]), new Color([34,139,34]), new Color([34,139,34])
]
});
CurrentLoc.setRenderer(renderer); What can I do to keep the SimpleMarkerSymbol and the Renderer? var CurrentLoc = new FeatureLayer("https://xxx/arcgis/rest/services/xxx/MapServer/1", {
mode: FeatureLayer.MODE_ONDEMAND,
outFields:["*"],
infoTemplate: new InfoTemplate("Locations - ${C_ID} - ${ORG}")
});
var marker = new SimpleMarkerSymbol().setPath("M14.5,29 23.5,0 14.5,9 5.5,0z").setAngle(180).setSize(20).setOutline(new SimpleLineSymbol().setColor("#ffffff").setWidth(2));
var renderer = new SimpleRenderer(marker);
renderer.setRotationInfo({
field: "HEAD",
rotationType: "arithmetic"
});
renderer.setColorInfo({
field: "SPEED",
minDataValue: 0,
maxDataValue: 150,
colors: [
new Color([255,0,0]), new Color([255,0,0]), new Color([34,139,34]), new Color([34,139,34]), new Color([34,139,34]), new Color([34,139,34]), new Color([34,139,34]), new Color([34,139,34])
]
});
CurrentLoc.setRenderer(renderer);
//add the legend
map.on("layers-add-result", function (evt) {
var layerInfo = arrayUtils.map(evt.layers, function (layer, index) {
return {layer:layer.layer, title:layer.layer.name};
});
if (layerInfo.length > 0) {
var legendDijit = new Legend({
map: map,
layerInfos: layerInfo,
}, "legend");
legendDijit.startup();
}
}); Is it because of this: If so how can I create an Arrow Symbol and set it to a specific angle via an attribute in the data? var marker = new SimpleMarkerSymbol().setPath("M14.5,29 23.5,0 14.5,9 5.5,0z").setAngle(180).setSize(20).setOutline(new SimpleLineSymbol().setColor("#ffffff").setWidth(2));
... View more
12-27-2017
11:18 AM
|
0
|
10
|
3278
|
|
POST
|
SO how would I add the hiding of layers with this exmaple? something like this: layerInfos: layerInfo[(3),(7)]; or here var layerInfo = [(2),(4),(12)]; //add the legend
map.on("layers-add-result", function (evt) {
var layerInfo = arrayUtils.map(evt.layers, function (layer, index) {
return {layer:layer.layer, title:layer.layer.name};
});
if (layerInfo.length > 0) {
var legendDijit = new Legend({
map: map,
layerInfos: layerInfo
}, "legend");
legendDijit.startup();
}
});
... View more
12-21-2017
07:54 AM
|
0
|
7
|
2245
|
|
POST
|
I'm just going to try and tackle your suggestion Ken.... https://www.arcgis.com/home/item.html?id=9b6280a6bfb0430f8d1ebc969276b109 Unless anyone has any other suggestions for gaining more control over the legend Most important if I was to use the one above is I HAVE to eliminate a couple of the Layers from the Legend...I DONT want to show them all. I dont know how to do that...the example just reads all the layers in
... View more
12-21-2017
05:04 AM
|
0
|
9
|
2245
|
|
POST
|
Using this ESRI service...not sure how to access it to see these parameters https://sampleserver6.arcgisonline.com/ArcGIS/rest/services/Elevation/ESRI_Elevation_World/GPServer/Viewshed know any more that are out there for free?
... View more
12-20-2017
01:10 PM
|
0
|
2
|
1822
|
|
POST
|
OK I came to the same realization that I was not handling the radio buttons correctly pertaining to retrieving the values and assigning them to variables. I came up with something similar and then checked back here to see your response var RadioDistance = document.getElementsByName('DistanceVS');
var Distance_value;
for(var i = 0; i < RadioDistance.length; i++){
if(RadioDistance[i].checked){
Distance_value = RadioDistance[i].value;
}
}
alert(Distance_value);
vsDistance.distance = (Distance_value); MY question is.... Am I using the correct parameter to change the observation height.... I clicked on an intersection with a 10 mile distance and 1 meter height I then clicked on the same intersection with a 10 mile distance and a 1000 meter height. The result is the same...I find that hard to believe the Viewshed would be the same at 1 meter and 1000 meters. Am I using the wrong parameter or setting it incorrectly? I want the Viewshed to take into account the increase elevation of an observation point and then adjust the viewshed result. Say I was standing on a 80 ft tower, what could I see I will tag yours as the answer.
... View more
12-20-2017
12:16 PM
|
0
|
4
|
1822
|
|
POST
|
I am trying to give the user a selection of radio buttons to choose the distsance Grab that value in JS and write it to a variable Use that variable in as a parameter for Viewshed Distance and Viewshed Observer Height Not sure why I cant get the radio button variable. Not sure if I use ID or NAME...I dont think I can use ID with a radio button selection <div>
<input type="radio" id="DistanceVS" name="DistanceVS" value="1" checked="checked">1 Mile</input>
<input type="radio" id="DistanceVS" name="DistanceVS" value="3" >3 Miles</input>
<input type="radio" id="DistanceVS" name="DistanceVS" value="5" >5 Miles</input>
<input type="radio" id="DistanceVS" name="DistanceVS" value="10" >10 Miles</input>
</div>
<div>
<div>
<input type="radio" name="HeightVS" value="1" checked="checked">1 Meter</input>
<input type="radio" name="HeightVS" value="3" >3 Meters</input>
</div>
<div>
<input type="radio" name="HeightVS" value="5" >5 Meters</input>
<input type="radio" name="HeightVS" value="10" >10 Meters</input>
</div>
</div>
function computeViewShed(evt) {
map.graphics.clear();
var pointSymbol = new SimpleMarkerSymbol();
pointSymbol.setSize(14);
pointSymbol.setOutline(new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([255, 0, 0]), 1));
pointSymbol.setColor(new Color([0, 255, 0, 0.25]));
var graphic = new Graphic(evt.mapPoint, pointSymbol);
map.graphics.add(graphic);
var features = [];
features.push(graphic);
var featureSet = new FeatureSet();
featureSet.features = features;
var vsDistance = new LinearUnit();
var vsHeight = new LinearUnit();
// TRYING TO GRAB THE VALUE AND ASSIGN TO VARIABLE AND ALERT
var radiodistance = document.getElementsByName('DistanceVS').value;
// OR
var radiodistance = dom.byId('DistanceVS').value;
alert(radiodistance);
var w = parseInt(radiodistance);
alert(w);
vsDistance.distance = (w);
// SAME AS THE ABOVE DISTANCE VARIABLE
var radioheight = document.getElementsByName('HeightVS').value;
var h = parseInt(radioheight);
vsHeight.distance = (h);
vsDistance.units = "esriMiles";
vsHeight.units = "esriMeters";
var params = {
"Input_Observation_Point": featureSet,
"Viewshed_Distance": vsDistance,
"observerHeight": vsHeight
};
gp.execute(params, drawViewshed, errorViewShed);
}
... View more
12-20-2017
11:13 AM
|
0
|
6
|
3057
|
|
POST
|
I get the below response for each of the alerts below. undefined NaN var radiodistance = document.getElementsByName('DistanceVS').value; alert(radiodistance); var w = parseInt(radiodistance); alert(w); vsDistance.distance = (w);
... View more
12-20-2017
10:14 AM
|
0
|
8
|
3057
|
|
POST
|
If I alert here var radiodistance = document.getElementsByName('DistanceVS'); alert(radiodistance); if gives me:
... View more
12-20-2017
09:35 AM
|
0
|
10
|
3057
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-20-2018 11:09 AM | |
| 1 | 09-10-2018 06:26 AM | |
| 1 | 09-15-2022 11:02 AM | |
| 1 | 05-21-2021 07:35 AM | |
| 1 | 08-09-2022 12:39 PM |
| Online Status |
Offline
|
| Date Last Visited |
09-19-2022
09:23 PM
|