|
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
|
2343
|
|
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
|
3964
|
|
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
|
3964
|
|
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
|
7031
|
|
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
|
808
|
|
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
|
3394
|
|
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
|
1146
|
|
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
|
1441
|
|
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
|
2770
|
|
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
|
2147
|
|
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
|
812
|
|
POST
|
Hi I've taken the default editor from http://help.arcgis.com/en/webapi/javascript/arcgis/demos/ed/ed_default_editingwidget.html and pointed it at a feature service of mine. It all displays all the edit stuff and allows me as far as clicking on a new location for the single point layer I have, but then nothing. In the console I get a error with the message "Unable to complete operation." The details of my feature layer are below. Any ideas? ACM Name: sde.SDE_ADMIN.zz_test_point Display Field: field1 Type: Feature Layer Geometry Type: esriGeometryPoint Description: Definition Expression: N/A Copyright Text: Default Visibility: true MaxRecordCount: 1000 Supported Query Formats: JSON, AMF Min Scale: 0 Max Scale: 0 Supports Advanced Queries: true Supports Statistics: true Extent: XMin: 287603.29310000036 YMin: 77481.15640000068 XMax: 336484.5109000001 YMax: 113666.57149999961 Spatial Reference: 27700 (27700) Drawing Info: Renderer: Unique Value Renderer: Field 1: field1 Field 2: null Field 3: null Field Delimiter: , Default Symbol: Style: esriSMSCircle Color: [0, 133, 163, 255] Size: 4.0 Angle: 0.0 XOffset: 0 YOffset: 0 Outline: [0, 0, 0, 255] Width: 1 Default Label: UniqueValueInfos: Value: Label: Description: Symbol: Style: esriSMSCircle Color: [173, 38, 171, 255] Size: 4.0 Angle: 0.0 XOffset: 0 YOffset: 0 Outline: [0, 0, 0, 255] Width: 1 Value: A Label: A Description: Symbol: Style: esriSMSCircle Color: [50, 133, 50, 255] Size: 4.0 Angle: 0.0 XOffset: 0 YOffset: 0 Outline: [0, 0, 0, 255] Width: 1 Value: B Label: B Description: Symbol: Style: esriSMSCircle Color: [140, 57, 36, 255] Size: 4.0 Angle: 0.0 XOffset: 0 YOffset: 0 Outline: [0, 0, 0, 255] Width: 1 Transparency: 0 Labeling Info: HasZ: false HasM: false Has Attachments: false HTML Popup Type: esriServerHTMLPopupTypeAsHTMLText Type ID Field: field1 Fields: OBJECTID ( type: esriFieldTypeOID , alias: OBJECTID , editable: false , nullable: false ) field1 ( type: esriFieldTypeString , alias: field1 , editable: true , nullable: true , length: 50 ) field2 ( type: esriFieldTypeString , alias: field2 , editable: true , nullable: true , length: 50 ) GlobalID ( type: esriFieldTypeGlobalID , alias: GlobalID , editable: false , nullable: false , length: 38 ) Types: ID: Name: Domains: Templates: Name: Description: Prototype: field1: Drawing Tool: esriFeatureEditToolPoint ID: A Name: A Domains: Templates: Name: A Description: Prototype: field1: A Drawing Tool: esriFeatureEditToolPoint ID: B Name: B Domains: Templates: Name: B Description: Prototype: field1: B Drawing Tool: esriFeatureEditToolPoint Capabilities: Create,Delete,Query,Update,Uploads,Editing Sync Can Return Changes: true Is Data Versioned: true Supports Rollback On Failure: false
... View more
07-05-2012
07:30 AM
|
0
|
2
|
1375
|
|
POST
|
Is it possible to also exclude the map service name? ACM Edit - OK - seen the title property in the reference.
... View more
07-04-2012
02:53 AM
|
0
|
0
|
1868
|
|
POST
|
Hi For me, none of the Edit samples, like http://help.arcgis.com/en/webapi/javascript/arcgis/demos/ed/ed_notoolbar.html work - loads of errors in the console, no points or polygons saving. Is this broken, or have I just tried at a time when the data are refreshing (which I presume Esri do every so often) Cheers ACM
... View more
07-02-2012
04:00 AM
|
0
|
1
|
734
|
|
POST
|
Edit 2 - Chrome updated to 20.something, and all seems fine - I'll leave this here just in case it re-appears. But panic over. I've a new map site, not yet live to the public, at http://maps2.eastdevon.gov.uk/mapping/assets/ - I've had it running in API 2.8 and 3.0 and this issue occurs in both. In chrome, it seem if I zoom in fast it freezes - or rather sits at a full core usage (so 50% on my dual core) - before Chrome finally asks if you to kill it, then of course, the "It's dead, Jim" message. As of now I am on 19.0.1084.56 m of Chrome, but I note there's an update waiting. IE9 and Firefox 12 seem fine. Any ideas? ACM PS - I should add that in my office, this works fine in Chrome, so it may be my PC, or it may be that inside our firewall requests hit our internal DNS then go straight to our relevant server, without leaving the building.
... View more
06-30-2012
01:58 AM
|
0
|
0
|
796
|
| 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 |
Wednesday
|