|
POST
|
Hi I have some code that uses an identify task. In the idenfify task execute function, I loop through the layers found and the fields found to build up a set of tables (one per layer) containing all the field aliases and values - basically recreating the ArcIMS html viewer Identify All results. I pop these up in a dojo dialog box. The box is defined by CSS as a specific percentage - .dijitDialog{ max-height: 50%; max-width:50%; overflow: auto; } this works fine for a few results, but when I have a fair few results, the vertical scroll bar appears - but the initial position is half way down the document. I'm not sure if this is something I've missed or an issue with dojo itself. Cheers ACM
... View more
09-03-2012
01:21 PM
|
0
|
1
|
1957
|
|
POST
|
As you say, awesome! Many thanks for pointing that out PS for others to working check this, I've added the code to my personal website http://chawke.co.uk/graphic_symbology.html PPS Some tweaking is needed for the latest versions, any version of the API over 2.0 breaks the layout, plus as discussed elsewhere the references to 'esri' needs moving to the end of the init function pps Not much needed for 3.1 API - just the moving the few references to the init function and making sure the CSS was pointed to 3.1 as well 😮 which I forgot the first time http://chawke.co.uk/g3.html for tweaked version for latest API
... View more
08-10-2012
10:54 PM
|
0
|
0
|
886
|
|
POST
|
Yay! that's the sort of thing, many thanks. Any worked example of adding text? Although I'm sure I can work that one out, an additional menu item, and maybe an additional drop down (or two for font size and font) PS - I'll explore the local storage route for all sorts of options as soon as I get a date for our XP >> Windows 7 roll out - at the moment I am limited to a user base with IE8
... View more
08-09-2012
10:23 PM
|
0
|
0
|
886
|
|
POST
|
Not really - it was adapting these examples http://help.arcgis.com/en/webapi/javascript/arcgis/demos/toolbar/toolbar_draw.html and http://help.arcgis.com/en/webapi/javascript/arcgis/demos/toolbar/toolbar_edit.html to allow users to change the style of the things they are drawing - the current redlining tool in ArcIMS allows them to define the style as they are drawing, but not to change it afterwards - so that is my baseline to achieve - my goal is to allow them to edit a set of layers (point, line, polygon, annotation) which then gets stamped with their AD name and filtered when it is displayed so only they can see it. I probably will have attributes that define the style - so a field called "Colour" and a pick list of a dozen or so. For the my users that'll be enough, it isn't a massively used feature, but one they will moan about if I replace the old ArcIMS tool with a new one. Cheers ACM
... View more
08-09-2012
01:02 PM
|
0
|
0
|
886
|
|
POST
|
Hi I can see how using the draw and edit toolbars I can allow my users to add their own stuff on a temporary basis, but is there any easy way yet to allow them to change the symbology of an individual item - plus to be able to add text? THey have been used to using the ArcIMS Redlining tool (http://arcscripts.esri.com/details.asp?dbid=14276) so my current project to move away from ArcIMS depends on being able to give them what they currently have. Cheers ACM
... View more
08-09-2012
01:15 AM
|
0
|
6
|
1678
|
|
POST
|
In case anyone else ins interested I worked it out - I have an array that contains the names of my default sub-layers, called defaultlayers, it is a global variable I then altered this part of the TOC.js
_createRootLayerTOC: function () {
var b = this.rootLayer;
if (!b._tocInfos) {
var c = {};
dojo.forEach(b.layerInfos, function (d) {
c["" + d.id] = d;
console.debug(d)
if (contains(defaultlayers,d.name)) {
d.visible = true;
}
else {
d.visible = false;
}
..... Cheers ACM
... View more
07-23-2012
01:59 AM
|
0
|
0
|
2809
|
|
POST
|
Hi Seeing this thread made me have another go at this TOC - last time I was still learning about the JSAPI I have a code base that I use for many pages that all share the same main dynamic map service - the main page calls the script and passes an array of default visible layers, this is then test for in my code and actioned -
function defaultvis(layer) {
visible = [];
var items = dojo.map(layer.layerInfos, function (info, index) {
if (contains(defaultlayers, info.name)) {
visible.push(info.id);
console.debug(info.name + "ative")
} else {
console.debug(info.name)
}
});
dynamicMapServiceLayer.setVisibleLayers(visible);
}
This works fine, but of course the TOC code doesn't pick up on the changed visibility and shows all layers unticked (the default state) Any ideas how I should call a refresh or something of the TOC to get the boxes ticked? Many thanks to the writer for a really nice TOC - it functions just as stated. Cheers ACM
... View more
07-20-2012
06:42 AM
|
0
|
0
|
2809
|
|
POST
|
It looks like you should be able just to add identifyParams.layerIds = visible to function executeIdentifyTask(evt) {
identifyParams.geometry = evt.mapPoint;
identifyParams.mapExtent = map.extent; to give you function executeIdentifyTask(evt) {
identifyParams.geometry = evt.mapPoint;
identifyParams.mapExtent = map.extent;
identifyParams.layerIds = visible Should work
... View more
07-17-2012
11:05 PM
|
0
|
0
|
4881
|
|
POST
|
Hi I thought I'd give something back for a change and couldn't see anything like this already posted. I wanted to use the popup widget as demonstrated on this sample. But use it so that the layer/field definitions were generated from the map service, in order to cut out hard coding changes, so if a new layer or field are added all that needs to be done is to ensure the alias is set in the MXD. Hacking around a few other samples and I ended up with this.
function executeIdentifyTask(evt) {
identifyParams.geometry = evt.mapPoint;
identifyParams.mapExtent = map.extent;
var deferred = identifyTask.execute(identifyParams);
deferred.addCallback(function (response) {
// response is an array of identify result objects
// Let's return an array of features.
return dojo.map(response, function (result) {
var feature = result.feature;
var infotext;
var rowc = 0;
infotext = "<table width=99% class='popuptable'>";
infotext += "<tr><th colspan='2' scope='col'>" + result.layerName + "</th></tr>";
for (j in result.feature.attributes) {
var template = new esri.InfoTemplate("", result.feature.attributes );
if (isEven(rowc)) {rowstyle='idlineeven'}
else{
rowstyle='idlineodd'
}
console.debug(result)
if (j.toUpperCase() != "OBJECTID" && j.toUpperCase() != "SHAPE" && j.toUpperCase() != "SHAPE_AREA" && j.toUpperCase() != "SHAPE_LENGTH") {
infotext += "<tr class='" + rowstyle + "'><th>" + j + ": </strong><td>";
infotext += result.feature.attributes + "</td></tr>" ;
rowc = rowc +1
}
}
infotext += "</table>"
var template = new esri.InfoTemplate("", infotext);
feature.setInfoTemplate(template);
map.infoWindow.resize(400, 200);
return feature;
});
});
map.infoWindow.setFeatures([deferred]);
map.infoWindow.show(evt.mapPoint);
}
I also needed a "Is a number odd or even function"
function isEven(value)
{
return /^\d+$/.test(value.toString()) ? (value%2 === 0 ? true : false ) : false;
}; In order to style the output nicely using basic CSS
.idlineeven {
background-color:#F30
}
.idlineodd {
background-color:#3C0
}
.popuptable{text-align:left}
Working example on my personal site Any comments or suggestions for improvement or areas where I've used bad practice would be welcome. As it mainly was a cut and paste job from various other examples I have no idea really how it works, it just does, 😄 Cheers ACM
... View more
07-16-2012
05:02 AM
|
0
|
0
|
664
|
|
POST
|
I had the same issue and resolved it like this. I use this function from one of the samples
function updateLayerVisibility() {
var inputs = dojo.query(".list_item"), input;
visible = [];
dojo.forEach(inputs,function(input){
if (input.checked) {
visible.push(input.id);
}
});
//if there aren't any layers visible set the array to be -1
if(visible.length === 0){
visible.push(-1);
}
dynamicMapServiceLayer.setVisibleLayers(visible);
}
I then added identifyParams.layerIds = visible In the relevant place and it all worked! I was quite surprised ACM
... View more
07-13-2012
06:53 AM
|
0
|
0
|
2339
|
|
POST
|
Ta- we read through that some time ago, but things have move on a lot since then - ArcGIS for Server is no only 64 bit and VMWare has gone through a few changes too. _ i'm not sure if tere was any hard conclusion over multi core vs single core. Anyone got any recent real world experiance?
... View more
07-12-2012
06:24 AM
|
0
|
0
|
673
|
|
POST
|
Are your aerials in ECW format? If so then ArcGIS server 10+ doesn't work with them, without a extra license - In theory you needed this for version 9.x, but it worked anyway. ACM
... View more
07-12-2012
02:53 AM
|
0
|
0
|
891
|
|
POST
|
Hi WE have AGS 10.1, of course on Server 2008R2. Running on a virtual server. Our server guys tell me there is a debate as to whether or not giving virtual servers multiple cores has any benefit. Apparently, they say, it is all down to the software, not only must be able to multi-thread, but also must be aware of the fact that it is on a Virtual server. What are peoples feelings/experience here on the matter? Cheers ACM
... View more
07-12-2012
02:43 AM
|
0
|
4
|
2297
|
|
POST
|
Hi I'm using 3.0 of the API and 10.1 AGS, so the latest public versions - I think I have set up my proxy as per the well linked post here (http://forums.esri.com/Thread.asp?c=158&f=2396&t=297001) and in my proxy config I have
<serverUrl url="http://maps2.mydomainname/arcgis/rest/services/securetest"
matchAll="true"
dynamicToken="true"
host="eddc-gis2"
userName="webmap"
password="password for the account webmap"></serverUrl>
The user webmap is in a user role, the role has all the requied rights. In the debug log I get
ARCGIS_TOKEN Authentication, Token is not available in the request, request is treated as anonymous
I am sure my page is calling the proxy page OK Any ideas people? I can't find a full walk through for setting this up, also I have found how to secure the services, how to generate a temporary token, but I can't see how to incorporate that token into my webpage (although I'll only need to use this if we open access to our services up to outside bodies, I do want to know) Cheers ACM
... View more
07-11-2012
02:32 AM
|
0
|
0
|
2005
|
|
POST
|
"no editable layers" so what have I missed in setting up the feature service. The SDE account has write rights, the layer has a GUID (I'm not sure this is needed, but it is for ArcGIS for Mobile), it is versioned. The Map Service is set for features? Cheers ACM
... View more
07-06-2012
01:51 AM
|
0
|
0
|
519
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-28-2025 01:14 AM | |
| 1 | 12-01-2023 06:07 AM | |
| 2 | 11-29-2024 04:32 AM | |
| 1 | 05-28-2024 12:50 AM | |
| 1 | 03-16-2023 06:46 AM |
| Online Status |
Offline
|
| Date Last Visited |
09-25-2025
03:26 AM
|