POST
|
I'm trying out the geometryEngine api from the JavaScript framework and it doesn't seem to work as intended. Some code to do distance between two points: require(["esri/geometry/geometryEngine"], function(geometryEngine) { this.sr = new esri.SpatialReference({ wkid: 4326 //decimal degrees }); this.distanceUnit = 9001; var distance = new Number(0); geometry1 = new esri.geometry.Point(-105, 40, this.sr); geometry2 = new esri.geometry.Point(-100, 30, this.sr); distance = geometryEngine.distance(geometry1, geometry2, this.distanceUnit); }); the distance returned seems to be a decimal-degree unit, not ever the units I specify (e.g. 9001:meter, 9036:kilometer, 9035:mile) Is there something I'm missing?
... View more
07-13-2015
05:14 PM
|
0
|
0
|
3714
|
POST
|
Here is the solution I found: don't use the ESRI library, use Spatial4j instead. Example use: Add to your pom: <dependency> <groupId>com.spatial4j</groupId> <artifactId>spatial4j</artifactId> <version>0.4.1</version> </dependency> in your class: Rectangle envelope = SpatialContext.GEO.makeRectangle(minlon, maxlon, minlat, maxlat); Point pt = SpatialContext.GEO.makePoint(lon, lat); boolean contains = false; if (envelope.relate(pt) == SpatialRelation.CONTAINS) { contains = true; } you can also check if your envelope crosses the dateline with this boolean response: envelope .getCrossesDateLine();
... View more
05-28-2015
09:42 AM
|
0
|
0
|
374
|
POST
|
You still want to query something. Tom's example is good, another typical 'dummy' query to get all data is: WHERE 1=1
... View more
04-24-2015
08:25 AM
|
0
|
0
|
759
|
POST
|
queryTask = new esri.tasks.QueryTask(gpURL);
//build query filter
query = new esri.tasks.Query();
query.returnGeometry = false;
query.outFields = ["*"];
query.geometry = geometry.mapPoint;
query.spatialRelationship = esri.tasks.Query.SPATIAL_REL_INTERSECTS;
queryTask.execute(query, successFunction, errorFunction); Use the error callback and see what the response objects say. Also, what are you querying? A where-clause, by geography, etc?
... View more
04-23-2015
10:40 AM
|
0
|
0
|
759
|
POST
|
I'm using the ESRI Geometry Java API https://github.com/Esri/geometry-api-java I want to construct an envelope and see if it contains certain points. It's possible the envelope crosses the International date line. Here is some sample code I've tried: double lon = Double.parseDouble("179.99");
double lat = Double.parseDouble("0");
Point pt = new Point(lon, lat);
double minlon = Double.parseDouble("170");
double minlat = Double.parseDouble("-20");
double maxlon = Double.parseDouble("-170");
double maxlat = Double.parseDouble("20");
Envelope ev = new Envelope(minlon, minlat, maxlon, maxlat);
SpatialReference sr = SpatialReference.create(4326); // decimal degrees
boolean test = GeometryEngine.contains(ev, pt, sr);
System.out.println(GeometryEngine.geometryToJson(sr, ev));
assertTrue("envelope containts point true", test); The test fails, and if I check the print statement I get a json that has swapped my x-coordinates {"xmin":-170,"ymin":-20,"xmax":170,"ymax":20,"spatialReference":{"wkid":4326}} Is there a different/better way to do this?
... View more
04-20-2015
04:57 PM
|
0
|
1
|
3599
|
POST
|
Ideally be able to determine if you are off-ground (building levels/roofs, poles, etc..).
... View more
04-09-2014
01:25 PM
|
0
|
0
|
589
|
POST
|
Hey, is there any way to use Collector (or any mobile ESRI app) to record Altitude along with Lat Long?
... View more
04-09-2014
01:01 PM
|
0
|
4
|
3977
|
POST
|
I'm looking to see if it's possible to layer multiple graphics (like a background graphic and a foreground graphic) for a single point? Ideally I don't want to create multiple features of the same point in the same or different layer. Perhaps someone has extended PictureMarkerSymbol to take in more than one img URL?
... View more
02-28-2014
08:33 AM
|
0
|
0
|
627
|
POST
|
Is it possible that the node used to generate the content for your infoWindow is getting destroyed between the first and second clicks? I had something similar happen to me when I closed the infoWindow and ended up having to clone the node for the infoWindow rather than assign it directly. Brittney, I think you are on the right track, though I'm not sure the best means of resolving the issue. On the first click (feature - onSelectionComplete) I can see the infoWindow with both .title and .content populated. However, on the subsequent click on the already selected feature, the .title stays the same, but the .content almost becomes empty - the main div remains (a BorderContainer), however the contents of the div are now empty (no more content pane's, etc..).
... View more
06-27-2013
09:35 AM
|
0
|
0
|
472
|
POST
|
Jon, Thanks for the response. However, those aren't the issue. I have already selected the feature, I'm not changing the feature (not clicking another feature), nor clearing features, simply clicking the same feature after the infoWindow has already popped up. At that point the infoWindow goes from populated data to blank.
... View more
06-14-2013
12:15 PM
|
0
|
0
|
472
|
POST
|
Upon clicking on a map feature (onClick -> Feature select -> onSelection -> go build an infoWindow) after building my infoWindow and creating a graphic I want to show the infoWindow:
var graphic = new esri.Graphic;
graphic.setGeometry(feature.geometry);
graphic.setAttributes(feature.attributes);
graphic.setSymbol(mySymbol);
var template = new esri.InfoTemplate();
template.setTitle('MyTitle');
template.setContent(bc.domNode); //dijit BorderContainer
graphic.setInfoTemplate(template);
map.graphics.add(graphic);
map.infoWindow.setContent(template.content);
map.infoWindow.setTitle(template.title);
map.infoWindow.show(graphic.geometry, map.getInfoWindowAnchor(graphic.geometry)); I get the immediate infoWindow to show, the graphic draws fine. Subsequent clicks on the same point shows a blank infoWindow, it only shows data again when I click away then click back on the point to restart the selection process.
... View more
06-14-2013
09:54 AM
|
0
|
6
|
1155
|
POST
|
You will have to iterate over your JSON data and build a table, e.g. if you did this in pure html: var html = ""; html += "<table border='1' width='100%'><tr><th>headerColumn1</th><th>headerColumn2</th></tr>"; for (var i = 0, il = mydata.length; i < il; i++) { html += "<tr><td>" + mydata.elementA + "</td>"; html += "<td>" + mydata.elementB + "</td>"; } html += "</tr></table>"; then the html could be added as the content to an infoWindow. a more complicated example, using a dojo grid: http://developers.arcgis.com/en/javascript/jssamples/fl_paging.html
... View more
06-11-2013
12:05 PM
|
0
|
0
|
798
|
POST
|
Hey, Building off of the infoWindow with tabs example. Currently I am dynamically building some tabs, e.g.: var tc = new dijit.layout.TabContainer({ style : "width:100%;height:250px;" }, dojo.create('div')); forEach(myData,function(data){ var cp1 = new dijit.layout.ContentPane({ title: "A title"}); cp1.setContent(layerTabContent(data)); // create an html table from data for tab content tc.addChild(cp1); }); The above works fine (though is really ugly, later I have to find the CSS that drives the tabs). I can take an infoWindow template: template.setContent(tc.domNode); graphic.setInfoTemplate(template); and these generated tabs show in the infoWindow. Now above these tabs I want an header of information for that point, e.g. address info: var html = '<div><table><tr><td><img src="icon.png"></td>'; html += '<td><span>' + feature.attributes["Address"] + '</span><br/>'; html += '</td></tr></table></div>'; if I were to setContent simply as this html that would work find, e.g.: template.setContent(html); graphic.setInfoTemplate(template); However, the issue is how to combine the tc.domNode with the html, since they are currently of different object types. Thoughts? Thanks!
... View more
06-11-2013
11:32 AM
|
0
|
1
|
471
|
POST
|
Is it possible to control/modify/disable the "searching" or "no results found" infoWindow's that pop up when using tasks like the IdentifyTask?
... View more
06-07-2013
09:58 AM
|
0
|
1
|
610
|
POST
|
Steve, Can you explain more as to "sporadic results"? I've been working on similar tasks but haven't seen issues (or at least I'm not paying attention if they are happening like you have..).
... View more
02-19-2013
01:56 PM
|
0
|
0
|
310
|
Title | Kudos | Posted |
---|---|---|
1 | 04-11-2012 02:42 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|