|
POST
|
Hi I have the follow routine that takes a newly made graphic and add the details to Local Storage. The idea is that it is then retrieved the next time the user uses the application
var graphic = new esri.Graphic(geometry, symbol);
console.debug(graphic)
// store to local storage graphic added
var now = new Date();
var n = now.getTime();
GraphicName = "storedGraphic" + n;
window.localStorage.setItem(GraphicName, dojo.toJson(graphic.toJson()));
console.debug(dojo.toJson(graphic.toJson()));
graphic.setAttributes({
newID: GraphicName
});
userGraphics.add(graphic);
It works fine, however I have recently given the users the ability to change outline colour. This then fails. Looking at my debugs - the first one (line 2 - I do like the new code format here, if nothing else ) returns Object {geometry: Object, symbol: Object, attributes: undefined, infoTemplate: undefined, declaredClass: "esri.Graphic"…} _extent: Object _graphicsLayer: Object _offsets: Array[1] _shape: Object attributes: Object geometry: Object infoTemplate: undefined symbol: Object _inherited: Object color: b.Color outline: Object _inherited: Object color: "#ff0000" style: "solid" width: "2" __proto__: Object style: "solid" __proto__: Object __proto__: Object Notice the Colour FF0000 - basically pure red. Now my second debug line, echoing out the JSON that I store into Local Storage {"geometry":{"rings":[[[323189.8652275379,87282.84014002334],[326479.760210035,88064.1901983664],[327302.23395565926,84363.05834305717],[323888.9679113185,82430.24504084015],[323189.8652275379,87282.84014002334]]],"spatialReference":{"wkid":27700}},"symbol":{"color":[0,0,0,179],"outline":{"color":[null,null,null,null],"width":1.5,"type":"esriSLS","style":"esriSLSSolid"},"type":"esriSFS","style":"esriSFSSolid"}} Look at all those nulls ! This means that the feature isn't retrieved properly, and I think may be causing issues with my print routine. Any ideas anyone? Cheers ACM Edit - yep this has a similar issue on printing - heres the Json of my print request - the same set of nulls
"featureSet": {
"geometryType": "esriGeometryPolygon",
"features": [{
"geometry": {
"rings": [
[
[310770.51166861143,
83910.69778296383
],
[314677.2619603267,
85473.39789964995
],
[315211.8698949825,
81525.52392065345
],
[313073.4381563594,
81114.28704784131
],
[310770.51166861143,
83910.69778296383
]
]
],
"spatialReference": {
"wkid": 27700
}
},
"symbol": {
"color": [0, 0, 0, 179],
"outline": {
"color": [null, null, null,
null
],
"width": 1.5,
"type": "esriSLS",
"style": "esriSLSSolid"
},
"type": "esriSFS",
"style": "esriSFSSolid"
}
}]
}
... View more
07-14-2014
07:17 AM
|
0
|
1
|
1559
|
|
POST
|
This is a known issue - several other threads lurking, good luck finding them : You need to force IE9 on the code <meta http-equiv='X-UA-Compatible' content='IE= 9, chrome=1'> Sorry - can't find the CODE flag on the new edit bar
... View more
07-14-2014
01:44 AM
|
0
|
0
|
1412
|
|
POST
|
Finished my other tasks early, so made this change now. I'll see what happens. Obviously your suggestion is good practice whatever, so I'll leave it there for good. MAny thanks
... View more
06-13-2014
06:14 AM
|
0
|
0
|
1145
|
|
POST
|
Nope - so far I've not focused on the TOC code, thinking it may be a AGS issue. Thanks for the suggestion - I may play around with moving the code next week, the problem is testing it, as it is so infrequent.
... View more
06-13-2014
05:58 AM
|
0
|
0
|
1145
|
|
POST
|
The code is in my init event, but I don't think it is the code as 97% of the time (rough guess ) it works fine Here's the code anyway
dojo.connect(dynamicMapServiceLayer, "onLoad", function (results) {
var toc = new agsjs.dijit.TOC({
map: map,
layerInfos: [{
layer: dynamicMapServiceLayer,
slider: true,
style: "inline",
title: "EDDC Layers",
isopen: true,
collapsed: true
}, {
layer: background,
slider: true,
title: "Basemaps",
noLegend: true,
isopen: false,
collapsed: true
}, {
layer: aerials,
slider: true,
title: "Aerials",
isopen: true,
collapsed: true
}, {
layer: altmaps,
slider: true,
title: "OS Basemaps",
isopen: false,
collapsed: true
}]
}, 'tocDiv');
toc.startup();
}); Thanks for taking a look ACM
... View more
06-13-2014
05:34 AM
|
0
|
0
|
1145
|
|
POST
|
Hi (apologies if this is considered a AGS issue - mods feel free to move) My users are reporting occasions when the TOC (Nianwei Liu's) doesn't populate. I rarely see it myself, but I just did, and by luck (as it is in IE) I had the F12 console up. No errors or messages at all. Digging into the Server logs and I can see some "WARNING Error getting service." With REST as the source No more details, but from my knowledge, failure to get any service details would indeed break the TOC, so this may be the cause of the TOC breaking, but has anyone any ideas why the service isn't being sent back? Cheers ACM
... View more
06-13-2014
04:12 AM
|
0
|
5
|
3201
|
|
POST
|
You should mark the question as answered, even if it's your own post that's the answer. This will help others as they search on this topic in the future. Mmm not sure about that - as I am part of a IT section we have firm rules over closing stuff. My solution we'd regard as a "work around" a fix that gets the user past the problem but without curing the actual problem. The problem is that either the API has a issue with IE10 and the touch part of the function I edit. Or my code causes issues when calling the API. It'll be nice if one of the Esri devs commented on this thread to give a indication if this is a known issue. Cheers ACM
... View more
06-06-2014
12:41 AM
|
0
|
0
|
2355
|
|
POST
|
Bump (again) This issue seems to have re-appeared with 3.9 - I googled it and found this thread and was amazed that I had a) started it and b) answered it! Made the same change again and so far so good.
... View more
06-05-2014
03:15 AM
|
0
|
0
|
2355
|
|
POST
|
Nice. +1 on loading screen You may like to see https://github.com/Chaussette/esri.symbol.FillPattern - extra code to allow coloured styled fills - neat. My internal site looks very similar! Lots of overlap. I have added the ability to save drawn graphics to local storage - I may be able to break the code out in a usable way if you are interested. ACM
... View more
05-08-2014
07:25 AM
|
0
|
0
|
2556
|
|
POST
|
Mmmm, my geodatabase is 10.1 and it all works, as long as layer is created with 10.2.2 client
... View more
05-05-2014
10:51 PM
|
0
|
0
|
814
|
|
POST
|
Hi Just read the sneak peak on the blog and excited by "Smarter data collection forms (including related tables)" Doe this mean, where I have a Tree layer, I can determine the contents of one attribute field based on another? So the Genus Field will only show relevant genuses (geni?) for the relevant species? If so this would be the final tick box for my tree people. ACM
... View more
05-05-2014
03:34 AM
|
0
|
0
|
933
|
|
POST
|
Ok - as no-one answered this I spent a day (of server time) generating a new tile package with a solid white polygon under everything else. Then, before I could load this file on, guess what happened ? The latest version came out and the annoying grid had gone, so my existing package worked. How dare you fix things like this 🙂
... View more
05-02-2014
01:27 AM
|
0
|
0
|
943
|
|
POST
|
It did surprise me when I saw it needed unversioned data - I was on "auto-pilot" setting the layer up and set it to be versioned at first, it was only reading the notes that I saw it needed unversioned. Luckily the datasets I'm looking at are single user ones (for editing) so hopefully that'll work. It'll be interesting to test to see how it handles two edits from differnt handhelds. Also fails - a shapefile imported into 10.1 Enterprise database in a 10.2.2 client. Creating the layer directly seems to only way
... View more
05-01-2014
06:07 AM
|
0
|
0
|
2614
|
|
POST
|
Has anything changed in server 10.2..2? I upgraded at the weekend, now ALL print requests that have text in them fail
Error {code: 400, message: "Unable to complete operation.", details: Array[1], log: undefined, httpCode: 400�?�}
_ssl: undefined
code: 400
details: Array[1]
httpCode: 400
log: undefined
message: "Unable to complete operation."
stack: (...)
get stack: function () { [native code] }
set stack: function () { [native code] }
__proto__: d
Print.js:24
I'm pretty sure it was all working before 10.2.2.?
... View more
05-01-2014
02:04 AM
|
0
|
0
|
2266
|
|
POST
|
OK - I had time to test it and it is as I guessed. The failed layer was created in the 10.1 Enterprise database using a 10.1 client, but then had the relevant tweaks needed for offline editing made in a 10.2.2 client The successful layer was created in the same 10.1 Enterprise database but from a 10.2.2 client. Using this approach I have a layer that I can edit and sync from Collector, but is totally useless as my 10.1 clients cannot view it! Doh! <face palm> ACM
... View more
04-28-2014
06:36 AM
|
0
|
0
|
2614
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-19-2026 12:29 AM | |
| 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 |
| Online Status |
Offline
|
| Date Last Visited |
Tuesday
|