POST
|
OK understood, thanks Robert. Unfortunately I have to work with v10.3 of the Flash Player, believe me I would move to a more recent version of the API if I could! Sam
... View more
08-07-2013
11:09 PM
|
0
|
0
|
162
|
POST
|
Hi Robert, Thanks for your quick response. I thought I had checked and double-checked the layer and field names and ruled out the possibility something was amiss there. Anyway, this morning I modified the names (in my mapservice and within the config) to:
<name>All Well Correlations</name>
<fields>
<field name="XSECTION_DESCRIPTION" alias="" />
<field name="SOURCE" alias="" />
<field name="HYPERLINK" alias="" />
</fields>
And all seems to work. I am not sure this made the difference, rather that I should have perhaps triple-checked yesterday! Thanks again Sam
... View more
08-01-2013
12:52 AM
|
0
|
0
|
238
|
POST
|
I am having an issue with the most recent version 2.5.8 of the Identify Widget. I have only two layers I wish to define hyperlinks for. When <layers onlythese="false"> the tool returns information for both. When <layers onlythese="true"> the tool will return information and display hyperlinks for the wells (points) layer ONLY. The Correlations layer (polyline) returns nothing. Config.xml file attached. I would be grateful for any assistance. (Limited to using 2.5 version due to enterprise version of Flash) Cheers
... View more
07-31-2013
10:41 AM
|
0
|
2
|
666
|
POST
|
SnappingManager works with any coordinate systems. Please try the code below. Hope this helps.
<script type="text/javascript">
dojo.require("esri.map");
dojo.require("esri.layers.FeatureLayer");
dojo.require("esri.SnappingManager");
dojo.require("esri.toolbars.draw");
var map, snap, featureLayer;
function init() {
var extent = new esri.geometry.Extent({"xmin":-96.6063,"ymin":38.3106,"xmax":-96.4764,
"ymax":38.3689,"spatialReference":{"wkid":4269}});
map = new esri.Map("map", { extent: esri.geometry.geographicToWebMercator(extent)});
var imagery = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer");
map.addLayer(imagery);
featureLayer = new esri.layers.FeatureLayer("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Hydrography/Watershed173811/FeatureServer/1",{
mode: esri.layers.FeatureLayer.MODE_ONDEMAND
});
map.addLayer(featureLayer);
dojo.connect(map, "onLoad", initSnapping);
}
function initSnapping(themap) {
var map = themap;
snap = new esri.SnappingManager({layerInfos:[{layer:featureLayer, snapToPoint: true, snapToEdge:false}], map: map, tolerence: 500});
toolbar = new esri.toolbars.Draw(map);
dojo.connect(toolbar, "onDrawEnd", addToMap);
}
function addToMap(geometry) {
toolbar.deactivate();
map.showZoomSlider();
var sPt = map.toScreen(geometry);
var defer = snap.getSnappingPoint(sPt);
defer.addCallback(function(result){
if(result){
var snapPoint = result;
console.log(snapPoint);
}
});
var symbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE, 10, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255, 0, 0]), 1), new dojo.Color([0, 255, 0, 0.25]));
var graphic = new esri.Graphic(geometry, symbol);
map.graphics.add(graphic);
}
dojo.addOnLoad(init);
</script>
</head>
<body class="tundra">
<button dojoType="dijit.form.Button" onClick="toolbar.activate(esri.toolbars.Draw.POINT);map.hideZoomSlider();">
Point
</button>
</div>
<div id="map" style="width:900px;height:500px;">
</div>
</body>
Thanks for this Jian. I don't have time to do any tests right now, but yesterday when I swapped out my WKID 4230 mapservice for an equivalent being served in 102100, the getSnappingPoint() method mysteriously started returning snap points. I'll look at the code you provided when I get a chance and see if I can see anything in my code that might be causing this.
... View more
06-03-2011
04:28 AM
|
0
|
0
|
856
|
POST
|
I had the same error with SnappingManager. Could it be that SnappingManager supports only WGS and Web Mercator spatial references? Couldn't find any information about such restriction, but the same code with other spatial references does not work Using screen coords instead of map coords produces the same error. Thanks for the tip giedrius_stanevicius, I am currently working in ED1950 GCS - I will test on a reprojected version.
... View more
06-02-2011
02:01 AM
|
0
|
0
|
856
|
POST
|
Please take a look at the document of SnappingManager. The method getSnappingPoint() returns a deferred object, which contains the closest point from a input location. Hope this helps. Thanks for this Jian. I've tried to implement but not had much luck. In the function below, I am looping through a set of polyline geometries, adding each one in turn to a graphics layer then attempting to calculate the snapping point (shortest diatance I hope) from a point feature (loc). No joy, I don't see as much as an error message. Chrome gives me a 'TypeError: Cannot read property 'valid' of undefined' on line 14 of the api which doesn't mean a whole lot to me...any ideas where I am going wrong? Thanks function pipeQueryCallback(pipeFeatureset){
if (pipeFeatureset.features.length > 0) {
var pipeGeoms = [];
var snappingManager = new esri.SnappingManager({alwaysSnap:true,
layerInfos:[{layer:graphicsLayer}],map:map,tolerance:1000});
dojo.forEach(pipeFeatureset.features,function(pipeFeature){pipeGeoms.push(pipeFeature.geometry)});
geomServ.intersect(pipeGeoms,bufferGeom,function(intPipeGeoms){
dojo.forEach(intPipeGeoms,function(intPipeGeom){
graphicsLayer.clear();
graphicsLayer.add(new esri.Graphic(intPipeGeom,symPipeDist));
var deferred = snappingManager.getSnappingPoint(loc);
deferred.then(function(value){
if(value !== undefined){
map.graphics.add(value,new esri.symbol.SimpleMarkerSymbol());
}
},function(error){alert(error.message)});
});
});
}
}
... View more
05-31-2011
12:03 AM
|
0
|
0
|
856
|
POST
|
Does anyone know the simplest way to return the closest point on a polyline to an input point using the javascript api with/without a geometry service? Perhaps I need to publish my own geoprocessing service to best achieve this functionality? Any pointers would be useful...thanks
... View more
05-24-2011
08:42 AM
|
0
|
12
|
3043
|
POST
|
Robert everything looks fine if i explicitly define an alias attribute on a hyperlink field e.g. alias="Link". Without this, the column name displayed on the grid is not the 'default' column alias and the hyperlinkaliastext is ignored. Hope this is helpful.
... View more
10-28-2010
12:57 AM
|
0
|
0
|
611
|
POST
|
Thanks Robert. I'm not sure the latest release has fixed the missing hyperlinks totally - it doesn't look like the field alias is being displayed in the datagrid and the hyperlinkaliastext attribute is being ignored - I'm seeing "Get Hyperlink" instead. Also I have found that if gridfieldonly="false" is defined in the field tag the field is not shown in the search widget itself (not a huge issue as it is the default and deleting it makes things better again). And thanks for all the work you are putting into this - it really is appreciated!
... View more
10-27-2010
07:45 AM
|
0
|
0
|
589
|
POST
|
Thanks for the updated version Robert. Field alias is now working great. Just noticed though that I'm not seeing my hyperlink field in the grid anymore - with or without <hyperlinkaliastext> defined. But it is in the .csv download (minus a column heading)...
... View more
10-27-2010
01:35 AM
|
0
|
0
|
595
|
POST
|
Robert / Erwan - nice looking widget. But am I right in thinking that the default search tool automatically displays a field's alias in the search tool widget? You only need define an alias attribute if you want to override the field alias. From my perspective it would be useful if your enhanced search widget could replicate this in the results grid. Also I'm only seeing the contents of the <titlefield> tag in the search widget itself... Here is one of my layers:
<layer>
<name>GCR - Geological Conservation Review Site</name>
<url>http://uk-abz-app10/ArcGIS/rest/services/env/envtest/MapServer/1</url>
<expression>UPPER("NAME") LIKE UPPER('%[value]%')</expression>
<textsearchlabel>Enter a GCR Review Site Name:</textsearchlabel>
<graphicalsearchlabel>Select a search tool:</graphicalsearchlabel>
<spatialsearchlabel>Select the two layers for spatial query</spatialsearchlabel>
<spatialsearchlayer>true</spatialsearchlayer>
<spatialrelationlayer>true</spatialrelationlayer>
<titlefield>NAME</titlefield>
<linkfield>CODELINK</linkfield>
<fields all="false">
<field name="CODE" alias="Code" gridfield="true"/>
<field name="NAME" alias="Name" gridfield="true"/>
<field name="COUNTRY" alias="Country" gridfield="true"/>
<field name="BLOCK" alias="Block" gridfield="true"/>
<field name="LOCAL_AUTH" alias="Local Authority" gridfield="true"/>
<field name="GRID_REF" alias="Grid Ref." gridfield="true"/>
<field name="EASTING" alias="Easting" gridfield="true"/>
<field name="NORTHING" alias="Northing" gridfield="true"/>
<field name="CODELINK" alias="Link" hyperlinkgridfield="true" hyperlinkaliastext="Link to JNCC data"/>
</fields>
</layer> Many thanks Sam
... View more
10-26-2010
06:07 AM
|
0
|
0
|
959
|
POST
|
Rob, This is a really great widget, functionality I'm sure should be included in the viewer by default! Would love to see some of the possible improvements already mentioned though, specifically: 1) The ability to exclude layers from the identify widget - perhaps only show info for those layers for which fields are defined in the config? 2) The ability to define multiple link fields Thanks Sam
... View more
10-14-2010
08:12 AM
|
0
|
0
|
371
|
POST
|
I'm using dijit bordercontainers / contentpanes to form the layout of my page. The contentpane holding my mapdiv is 'dynamically' sized i.e. I am not able to assign it a height or width (although I have attempted both to try to get it to work!). The issue I am having is onload - not having a width/height means the gmap will not load into the div correctly. Resize the window and hey presto the div gets a width/height and all is good. But obviously I want it to work from the off! Sample of my problem here: http://tinyurl.com/234st2s Can anyone help? I'm sure there's something simple I'm missing but i've exhausted possible fixes I've been able to find. Thanks
... View more
04-27-2010
09:11 AM
|
0
|
0
|
446
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|