|
POST
|
Something like this? require([
"esri/tasks/query", "esri/tasks/QueryTask"],
function (
Map, Query, QueryTask) {
parser.parse();
//Geometry Service
var geometryService = new GeometryService("http://sampleserver5.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer");
var query = new Query();
var queryTask = new QueryTask( MY MAP SERVICE URL );
query.outSpatialReference = {wkid:26917}; // UTM Zone 17 N
query.returnGeometry = true;
queryTask.execute(query, getPoints);
function addPointsToMap(results) {
var polygon = results.features[0].geometry;
var pnt = new Point(4147263, 646445.066, new SpatialReference({ wkid: your datas wkid # }));
if (polygon.contains(pnt)){
console.info("point is inside polygon");
}else{
console.info("point is NOT inside polygon");
}
}
});
});
... View more
02-07-2017
10:08 AM
|
0
|
26
|
2052
|
|
POST
|
SO if I did something along these lines....how do I get all the XYs to a variable or array to be used in the original code above? require([
"esri/tasks/query", "esri/tasks/QueryTask", ...
], function(Query, QueryTask, ... ) {
var query = new Query();
var queryTask = new QueryTask( ... );
query.outSpatialReference = {wkid:102100};
query.returnGeometry = true;
query.outFields = ["CITY_NAME"];
queryTask.execute(query, addPointsToMap);
...
});
... View more
02-07-2017
09:26 AM
|
0
|
28
|
4081
|
|
POST
|
Sorry for the stupid question...but what am I querying the Map Service for? Pretty confused.
... View more
02-07-2017
09:20 AM
|
0
|
0
|
4080
|
|
POST
|
If I use Feature Vertices to Point tool to get a list of XYs for the State Boundary I end up with over 50,000 XY coordinates. I am supposed to create a list int he code with 50,000 XY coordinates and process against that? Just seems like there should be an easier way.
... View more
02-07-2017
09:14 AM
|
0
|
31
|
4081
|
|
POST
|
Close to what I have above....my issue is that I have a state polygon that will have thousands of XY nodes...I was trying to point at a Map Service Layer instead of listing out 10s of thousands of XY coordinates.
... View more
02-06-2017
01:41 PM
|
0
|
33
|
4081
|
|
POST
|
I think that would work....looking for an example or two...thoughts?
... View more
02-06-2017
01:31 PM
|
0
|
35
|
4081
|
|
POST
|
Is there a way via JS or Python to simply pass an XY to a function and determine if inside or outside a polygon (from a map Service) I need to do this for Decimal Degrees, DMS, UTM etc. I can do it like below BUT I would have to list out EVERY node and trying to do this for a complete state function inside(point, vs) {
var x = point[0], y = point[1];
var inside = false;
for (var i = 0, j = vs.length - 1; i < vs.length; j = i++) {
var xi = vs[i][0], yi = vs[i][1];
var xj = vs[j][0], yj = vs[j][1];
var intersect = ((yi > y) != (yj > y))
&& (x < (xj - xi) * (y - yi) / (yj - yi) + xi);
if (intersect) inside = !inside;
}
return inside;
};
var polygon = [[4040958.21,261090.239],[4399737.773,261090.239], [4399737.773,1004118.285],[4040958.21,1004118.285]]
<!--// The below are two examples. One of them is inside the other is outside to bounding box
// inside -->
test = inside([ 4147263, 646445.066 ], polygon); // true
<!-- // outside -->
<!--
test = inside([ 4537048, 694061 ], polygon); // false
-->
alert(test);
... View more
02-06-2017
01:23 PM
|
1
|
40
|
15949
|
|
POST
|
have been away from the coding world for a bit and confused... I love the new print widget in 4.2 that allows the user to specify a title etc. ArcGIS API for JavaScript Sandbox I never saw this in 3.19 I grabbed the 4.2 Print code but now: I am trying to add some code where the user can add a PictureMarkerSymbol in the map via map click I am also trying to add some code where the user can add a PictureMarkerSymbol after manually entering XY Coordinates I know this is a completely different api and the code doesnt jive between them.... Is there a way to add a PicturemarkerSymbol in the two instances I explained above in the 4.2 api? I dont see any examples on ESRI website. Even a drawing widget would be ok...but still need to add PictureMarkerSymbol via Manually entered XY via the user.
... View more
01-27-2017
08:50 AM
|
0
|
1
|
1037
|
|
POST
|
Is there a way to modify the click event that drops the text in the map to where it adds the text to the right of the user click. Not in the middle... Where ever I click I want the text to be centered vertically and all text moving to the right
... View more
01-27-2017
08:14 AM
|
0
|
0
|
4553
|
|
POST
|
Got it...think this is what you were referring too. require(["esri/map", "esri/geometry/webMercatorUtils", "esri/symbols/SimpleLineSymbol", "esri/graphic", "esri/symbols/SimpleMarkerSymbol", "esri/Color", "dojo/on", "dojo/dom", "esri/geometry/Point", "dojo/domReady!" ], function(Map, webMercatorUtils, SimpleLineSymbol, Graphic, SimpleMarkerSymbol, Color, on, dom, Point) {
... View more
01-26-2017
05:38 PM
|
0
|
1
|
1218
|
|
POST
|
I have an old script that I am trying to use and it does not seem to work. The topo comes up but when I enter an XY and hit Go nothing happens.... I updated the 2 lines below <link rel="stylesheet" href="https://js.arcgis.com/3.19/esri/css/esri.css"> <script src="https://js.arcgis.com/3.19/"></script> Does ANYTHING stand out that is not used in the current js 3.19? <!DOCTYPE html>
<html>
<head>
<title>Simple Map</title>
<link rel="stylesheet" href="https://js.arcgis.com/3.19/esri/css/esri.css">
<script src="https://js.arcgis.com/3.19/"></script>
<style>
html, body, #map {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
body {
background-color: #FFF;
overflow: hidden;
font-family: "Trebuchet MS";
}
</style>
<script>
var map;
require(["esri/map",
"esri/symbols/SimpleLineSymbol",
"esri/graphic",
"esri/symbols/SimpleMarkerSymbol",
"esri/Color",
"dojo/on",
"dojo/dom",
"esri/geometry/Point",
"dojo/domReady!"
],
function(Map, SimpleLineSymbol, Graphic, SimpleMarkerSymbol, Color, on, dom, Point) {
map = new Map("map", {
basemap: "topo",
center: [-122.45, 37.75], // longitude, latitude
zoom: 13
});
var symbol = new SimpleMarkerSymbol(
SimpleMarkerSymbol.STYLE_CIRCLE,
15,
new SimpleLineSymbol(
SimpleLineSymbol.STYLE_SOLID,
new Color([0, 0, 255, 0.5]),
8
),
new Color([0, 0, 255])
);
function coordinates() {
console.log("Coordinates")
var lat = document.getElementById("sel_lat").value
var longitude = document.getElementById("sel_long").value
var coord = webMercatorUtils.lngLatToXY(longitude, lat);
var mp = new Point(longitude, lat);
var graphic = new Graphic(mp, symbol);
map.graphics.add(graphic);
map.centerAndZoom(mp, 9);
}
on(dom.byId("go"), "click", coordinates);
});
</script>
</head>
<body>
<div id="map">Tag Long:<input id="sel_long" type="text">
<br />
Tag Lat:<input id="sel_lat" type="text">
<br />
<button id="go">GO</button>
</div>
</body>
</html>
... View more
01-26-2017
09:21 AM
|
0
|
3
|
1874
|
|
POST
|
I have an existing project that I have been collecting data with. I need to add a field in Survey123. When I go to publish it tells me that it exists and I might loose all my data that I collected. Does it really delete all the records and attachments? What can I do?
... View more
01-05-2017
10:59 AM
|
0
|
5
|
2682
|
|
POST
|
I am not too familiar with this code snip as I received it through this post....but seems that its trying to authenticate a certificate on the server.... do you have valid certificates on the server? Does the user specified have the appropriate permissions to do this task? Callum Smith any thoughts?
... View more
12-20-2016
06:43 PM
|
1
|
1
|
1807
|
|
POST
|
OK...I was able to get this working.... But my question is how can I get a bit more effective with the html formatting...Maybe a vertical table? Any ideas on how to modify this to be a vertical table? Im not sure how to target the specific fields to put in the html formatting. Thoughts? DESIRED_COLUMNS = ('county','ramp','date','trailblazers','regulations','safteygsign','rutfree','potholes','grass','trash','portapotties','lighting',
'courtesypier','boatslide','fishingpier','debris','potholesramp','bulkhead','shoreline','contractor','comments','CreationDate','Creator','EditDate','Editor')
f2 = open("z_outFileRegion3.csv")
reader = csv.reader(f2)
headers2 = [1,2,3,4,8,12,16,20,24,28,32,36,41,45,49,53,57,61,65,69,74,75,76,77,78]
results2 = []
for row in reader:
if not headers2:
headers2 = []
for i, col in enumerate(row):
if col in DESIRED_COLUMNS:
# Store the index of the cols of interest
headers2.append(i)
else:
results2.append(tuple([row for i in headers2]))
#...SNIP
cols1 = ["<td>{0}</td>".format( "<td><td/>".join(t)) for t in results2]
rows1 = "<tr>{0}</tr>".format( "<tr><tr/><br>".join(cols1))
html1 = """<HTML>
<body>
<h4>Attendance list</h4>
<table>
{0}
</table>
</body>
</HTML>""".format(rows1)
part4 = MIMEText(html1, 'html')
msg.attach(part4)
#...SNIP
... View more
12-20-2016
09:25 AM
|
0
|
0
|
2556
|
| 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
|