POST
|
Thank you Previn, I've been searching for an example, could you direct me to an example that uses nested "for loops?"
... View more
07-06-2015
08:59 AM
|
0
|
0
|
358
|
POST
|
Hi I'm trying to sum the distances between points by loop through point in a path and calling the geometeryService.distance method then adding the result to a total variable, which is then used for another calculation. However, the code is not waiting for the "for loop" to complete before moving on to the next line (which surprised me). Am I doing something wrong in how I get the distance? Or how can wait the "for loop" to complete before moving on? identifyTask.execute(identifyParams, function (idResults) { if (idResults.length > 0) { var polyl; var mpdistance = 0; for (var r = idResults.length - 1; r >= 0; r--) { polyl = idResults .feature.geometry; var feature = idResults .feature; var geometryService = new GeometryService("http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"); var distParams = new DistanceParameters(); distParams.distanceUnit = GeometryService.UNIT_STATUTE_MILE; distParams.geometry1 = evt.mapPoint; distParams.geodesic = true; dojo.forEach(polyl.paths, function (path, i) { var beginpoint = polyl.getPoint(0, 0); for (j = 0; j < path.length; j++) { mp = polyl.getPoint(i, j); distParams.geometry1 = beginpoint; distParams.geometry2 = mp distParams.geodesic = true; geometryService.distance(distParams, function (distance) { mpdistance += distance; }); beginpoint = polyl.getPoint(i, j); } }); } map.infoWindow.setContent("Road Name:" + feature.attributes['RoadName'] + " MilePost:" + mpdistance + ""); map.infoWindow.setTitle("Road:" + feature.attributes['RoadName']); map.infoWindow.show(evt.mapPoint); } });
... View more
07-02-2015
03:04 PM
|
0
|
3
|
3198
|
POST
|
Thank you Robert, I have feature set of results from Identify task. Do I define a Polyline then set the geometry equal to the geometry of the found feature? IdentifyTask.execute (paramters, function (idResults) { if (idResults.length > 0) {function (result) { var foundroadgeometry = result.feature.geometry; var feature = result.feature; var polyline = new esri.geometry.Polyline(map.spatialReference); polyline.geometry = foundroadgeometry; } }); Like that?
... View more
06-30-2015
02:02 PM
|
0
|
1
|
482
|
POST
|
Thank you Xander, do you know what property of the line I would loop through to get the vertice pairs?
... View more
06-30-2015
01:30 PM
|
0
|
5
|
482
|
POST
|
Hi, I'm trying to get the milepost on a road segment returned from Identity Task (or some other way) in JavaScript. The road segment has Beginning MP and Ending MP as attributes. is there a tool that can calculate (or return) where I clicked on the road? Do you I need to change how road layer is published (using routing)?
... View more
06-30-2015
11:00 AM
|
0
|
7
|
3506
|
POST
|
Hi, I would like to customize the search results info template to include specific AND keep the "Show More Results" feature of the popup. When I customize the popup the "Show more Results" feature disappears. How can I add custom fields AND keep that feature?
... View more
06-03-2015
09:16 AM
|
0
|
0
|
3121
|
POST
|
Yes I'm sure it is correct. Not sure if there is security on it?
... View more
05-15-2015
07:06 AM
|
0
|
1
|
855
|
POST
|
Also...I have different layers in my map service, and I am trying to hover over a point.
... View more
05-15-2015
06:52 AM
|
0
|
3
|
855
|
POST
|
I took the code from example altered to use my map service, I am missing something because I can't get mouse move to fire.
var map, dialog;
"esri/map", "esri/layers/FeatureLayer",
"esri/symbols/SimpleFillSymbol", "esri/symbols/SimpleLineSymbol",
"esri/renderers/SimpleRenderer", "esri/graphic", "esri/lang",
"esri/Color", "dojo/number", "dojo/dom-style",
"dijit/TooltipDialog", "dijit/popup", "dojo/domReady!"
function (
new Map("mapDiv", {
"streets",
false
var southCarolinaCounties = new FeatureLayer("http://gisappserv3/ArcGIS/rest/services/Engineering/MaintenancePoints/MapServer", {
"District"]
// southCarolinaCounties.setDefinitionExpression("STATE_NAME = 'Washington'");
var symbol = new SimpleFillSymbol(
new SimpleLineSymbol(
new Color([255, 255, 255, 0.35]),
new Color([125, 125, 125, 0.35])
new SimpleRenderer(symbol));
new TooltipDialog({
"tooltipDialog",
"position: absolute; width: 250px; font: normal normal normal 10pt Helvetica;z-index:100"
var highlightSymbol = new SimpleFillSymbol(
new SimpleLineSymbol(
new Color([255, 0, 0]), 3
new Color([125, 125, 125, 0.35])
//close the dialog when the mouse leaves the highlight graphic
"load", function () {
"mouse-out", closeDialog);
//listen for when the onMouseOver event fires on the countiesGraphicsLayer
//when fired, create a new graphic with the geometry from the event.graphic and add it to the maps graphics layer
"mouse-over", function (evt) {
'here');
var t = "<b>${District}</b>";
var content = esriLang.substitute(evt.graphic.attributes, t);
var highlightGraphic = new Graphic(evt.graphic.geometry, highlightSymbol);
"opacity", 0.85);
function closeDialog() {
... View more
05-15-2015
06:48 AM
|
0
|
1
|
855
|
POST
|
Thank you, it's not quite working for me with the map service I am using. How do you paste javascript into a reply?
... View more
05-14-2015
03:36 PM
|
0
|
7
|
855
|
POST
|
Hi, I can easily identify a feature on layer by using onClick and Identifytask. However I would like to identify a feature of specific layers in a map service by hovering over instead of clicking. I tried using a QueryTask but I'm not really querying the layer (I don't have a where). Which method is the best to use?
... View more
05-14-2015
02:37 PM
|
0
|
11
|
4816
|
POST
|
Thank you Tim, The zoom link is not being display. I am using the popup in a cluster layer...do you think that might be why it's not displaying? var infoTemplate = new InfoTemplate(); infoTemplate.setTitle("Facility"); infoTemplate.setContent("<b>ID:</b>${FacilityID}<br/><b>Facility Type:</b>${FacilityType}<br/><a href='SWUViewInspectionDetail.htm?id=${ID}' target='_blank'>Details</a><br/>"); new ClusterLayer({ "data": photoInfo.data, "distance": 50, "id": "clusters", "labelColor": "#fff", "labelOffset": 10, "resolution": map.extent.getWidth() / map.width, "singleColor": "#888", "singleTemplate": infoTemplate
... View more
04-27-2015
11:55 AM
|
0
|
1
|
271
|
POST
|
Hi I've been looking at popup samples with "Zoom" links but am unable to figure out how to put the links on the popup. Here is one of the samples I was looking at Format info window content | ArcGIS API for JavaScript I know I am missing something...what am I missing?
... View more
04-27-2015
11:32 AM
|
0
|
3
|
2606
|
POST
|
I got it... photoInfo.data = arrayUtils.map(obj, function (p) { photocnt += 1; var rec = p.split(";"); var latlng = new Point(parseFloat(rec[2]), parseFloat(rec[3]), wgs); var webMercator = webMercatorUtils.geographicToWebMercator(latlng); var attributes = { "ID": rec[0], "MaintDate": rec[1], "FacilityType": rec[4] }; return { "x": webMercator.x, "y": webMercator.y, "attributes": attributes }; }); // popupTemplate to work with attributes specific to this dataset var popupTemplate = PopupTemplate({ "title": "", "fieldInfos": [{ "fieldName": "ID", visible: true }, { "fieldName": "MaintDate", "label": "Date", visible: true }, { "fieldName": "FacilityType", "label": "Facility", visible: true }], "mediaInfos": [{ "title": "", "caption": "", "type": "image", "value": { "sourceURL": "SWUGetImageHandler.ashx?maintid=" + '{ID}' } }] });
... View more
04-14-2014
10:23 AM
|
0
|
0
|
227
|
POST
|
Hi I'm trying to display an image in a popup similar to the example https://developers.arcgis.com/javascript/jssamples/layers_point_clustering.html except the images are retrieved through a handler from SQL server. Here is code to get date for template, can I use a URL to get image? (see bold/underline) photoInfo.data = arrayUtils.map(obj, function (p) { photocnt += 1; var rec = p.split(";"); var latlng = new Point(parseFloat(rec[2]), parseFloat(rec[3]), wgs); var webMercator = webMercatorUtils.geographicToWebMercator(latlng); var attributes = { "ID": rec[0], "MaintDate": rec[1], "FacilityType": rec[4], "Image": "GetImageHandler.ashx?signid=" + rec[0] }; return { "x": webMercator.x, "y": webMercator.y, "attributes": attributes }; }); Here is popup template... var popupTemplate = PopupTemplate({ "title": "", "fieldInfos": [{ "fieldName": "ID", visible: true }, { "fieldName": "MaintDate", "label": "Date", visible: true }, { "fieldName": "FacilityType", "label": "Facility", visible: true }], "mediaInfos": [{ "title": "", "caption": "", "type": "image", "value": { "sourceURL": "{Image}" } }] });
... View more
04-14-2014
10:03 AM
|
0
|
1
|
447
|
Title | Kudos | Posted |
---|---|---|
1 | 02-04-2016 03:03 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|