|
POST
|
Some of the fairly complex but less known functionality was dropped to simplify the code upgrade, such as creation of check box on legend items based on UniqueValueRenderer, I just noticed this, shame, I was selling that as a neat new feature to my users - any chance of adding this back in as an option? I agree it wasn't for everyone, as if you had a poorly index/large layer it did have a server hit. Cheers ACM
... View more
08-19-2013
02:36 AM
|
0
|
0
|
2464
|
|
POST
|
Well, I did get the error to go away, but no idea how. I have three versions, a internet "frozen" version from April - worked. A Live version - failed and a Dev version - worked ! So I finished what I was doing on Dev and made it live. So no idea what it was. ACM
... View more
08-14-2013
12:13 AM
|
0
|
0
|
683
|
|
POST
|
Thanks for that - our users are used to this behaviour - turning on greyed out layers, even through nothing will appear until the zoom is changed, as that is what I gave them 7 years back in my ArcIMS site, using David Bollinger's TOC. So, they seem to be able to cope. I'll take a look at your suggestion next time I'm doing work on my site - many thanks. ACM
... View more
08-13-2013
03:19 AM
|
0
|
0
|
2960
|
|
POST
|
Hi I've found I had made one other hack to the old code. Basically I want my users to be able to switch greyed out layers on, even when they are greyed out, so they will draw when the users zooms in enough to see them. On the latest version I change this line if (this.checkNode) if (this.checkNode.set) this.checkNode.set("disabled", a); To if (this.checkNode) if (this.checkNode.set) ; Is there a better way of doing this without having to hack the code? Cheers ACM
... View more
08-12-2013
03:45 AM
|
0
|
0
|
2960
|
|
POST
|
🙂 I was just wondering myself if you could CAST a geometry column. FYI - 10.2 behaves in exactly the same way with the approach I was using in 10.1 trying the CAST now. ACM
... View more
08-07-2013
03:45 AM
|
0
|
0
|
839
|
|
POST
|
Hi - tried that with an Esri view, and failed. I tried to do it setting the view up on SQL, but couldn't get the syntax right for "GEOMETRY=POINT" or whatever. Anyway, esri(uk) have told me they think 10.2 will work better, so I'm about to install that on a VPC to take a look. Cheers ACM
... View more
08-07-2013
12:24 AM
|
0
|
0
|
839
|
|
POST
|
maybe some hints here http://stackoverflow.com/questions/4940586/can-you-use-html5-local-storage-to-store-a-file-if-not-how writing local storage to text file using the File API
... View more
08-06-2013
06:33 AM
|
0
|
0
|
2926
|
|
POST
|
Hi I have a drawing toolbar that allows my users to add graphics. Using this sample I have added context menu to edit the shapes they have drawn. My users can add textsymbols (which have a point geometry) this part of the code ctxMenuForGraphics.addChild(new dijit.MenuItem({ label: "Rotate/Scale", onClick: function() { if (selected.geometry.type !== "point") { editToolbar.activate(esri.toolbars.Edit.ROTATE | esri.toolbars.Edit.SCALE, selected); } else { alert("Not implemented"); } } })); Prevents the rotate option being enabled for the textsymbol. However my users want to be able to rotate textsymbols. If I remove the check for POINTS in the code above I don't get the "Not implemented" warning, but I also don't get any rotate handles. The TextSymbol does have a rotation property, so I could get that set when it is generated, but the user wil have to be good with angles. Any thoughts? ACM
... View more
08-06-2013
05:55 AM
|
0
|
9
|
4788
|
|
POST
|
Hi I have a SQL database. In this SQL database is a SQL Spatial table, from a NONE Esri source. This table has mixed (ug!) geometries, points, multiponts and polygons. This table is from a third party application and I have NO control over it. I can view the data OK in ArcMap, when I add it on, I have to choose the geometry type and unique field. However, if I try to do anything with layers I get a 99999 error "Invalid Entity type" What I'm trying to do is to take this source, buffer the point features, then merge it with the polygon features to create a single ArcMap friendly layer. Cheers ACM
... View more
08-05-2013
06:41 AM
|
0
|
4
|
952
|
|
POST
|
Hi I'm not sure if this is a small glitch, but I used to have
{
layer: aerials,
slider: true,
title: "Aerials",
collapsed: true
}
To define a TOC on my aerial service, which is pure rasters, with nothing switched on by default. Using the latest version this gets classed as a un-openable menu item
<img src="http://my server/arcgis_js_api/library/3.5/jsapi/js/dojo/dojo/resources/blank.gif" alt="" data-dojo-attach-point="iconNode" class="dijitTreeExpando dijitTreeExpandoClosed" style="visibility: hidden;">
A very small tweak to my code
{
layer: aerials,
slider: true,
title: "Aerials",
isopen: true,
collapsed: true
}
and all is fine Cheers ACM
... View more
08-05-2013
06:32 AM
|
0
|
0
|
4269
|
|
POST
|
Brilliant! Missed that, I'll take a look at it now and revert to the original code. Nice update - grouped styles work as they do in ArcMap now, rather than being split by the unique values.
... View more
08-05-2013
05:46 AM
|
0
|
0
|
4269
|
|
POST
|
Liu - many thanks for the update. The only non-style based change I make is to this line templateString: '<div class="agsjsTOCNode"><div data-dojo-attach-point="rowNode" data-dojo-attach-event="onclick:_onClick"><span data-dojo-attach-point="contentNode" class="agsjsTOCContent"><span data-dojo-attach-point="checkContainerNode"></span><img class="tocimage" src="${_blankGif}" alt="" data-dojo-attach-point="iconNode" /><span data-dojo-attach-point="labelNode"></span></span></div><div data-dojo-attach-point="containerNode" style="display: none;"> </div></div>',
adding a class to the image - any chance of adding that to your version? It justs gives me a bit more control over style - I add a vertical-algn:bottom to mine. Many thanks ACM
... View more
08-05-2013
05:07 AM
|
0
|
0
|
4269
|
|
POST
|
It will be a great point to start, though what I need is the ability to save the graphics to a external file that can be shared among users. would you share the code?:) OK - here goes - I have this function that is mainly copied from elsewhere
function addToMap(geometry) {
//drawToolbar.deactivate();
a = dijit.byId("tslider").value;
c = hexToRgb(graphicColour, a);
fullcolour = new dojo.Color(c);
// fillStyle = dijit.byId('fillSelect').attr('value');
var psize = dijit.byId("font.size").value;
psize = psize.replace("pt", "");
switch (geometry.type) {
case "point":
var symbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_CIRCLE, psize, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255, 0, 0]), 1), new dojo.Color(graphicColour));
if (drawtype == 'Text') {
fullcolour = new dojo.Color([0, 0, 0, 255]);
var font = new esri.symbol.Font(dijit.byId("font.size").value, esri.symbol.Font.STYLE_NORMAL, esri.symbol.Font.VARIANT_NORMAL, esri.symbol.Font.WEIGHT_NORMAL, "verdana");
var symbol = new esri.symbol.TextSymbol(dijit.byId("usertext").value, font, fullcolour).setAngle(0).setOffset(0, 0).setAlign(esri.symbol.TextSymbol.ALIGN_START).setDecoration(esri.symbol.TextSymbol.DECORATION_NONE).setRotated(false).setKerning(true);
}
break;
case "polyline":
var symbol = new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, fullcolour, dijit.byId("line.size").value);
break;
case "polygon":
var symbol = new esri.symbol.SimpleFillSymbol(dijit.byId('fillSelect').attr('value'), new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([0, 0, 0]), dijit.byId("line.size").value), fullcolour);
break;
}
console.debug(symbol)
var graphic = new esri.Graphic(geometry, symbol);
// 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()));
graphic.setAttributes({
newID: GraphicName
});
userGraphics.add(graphic);
//enableID();
}
The important bits are to the end - I generate a unique name for this stored graphic, based on the time. Then save it to local storage. Initially I also deactivated the draw tools and reactivated the ID tool - but as you see I've changed my mind on this - these only get changed when the user closes the floating pane I have the tools in. I then have this, that re-loads it all next session
//graphics stored in local srtorage and display it.
for (var i = 0; i < localStorage.length; i++) {
var n = "SavedGraphic" + i;
var key = localStorage.key(i);
//we use local storage for other things, so only read in storedgraphics
if (Left(key, 8) == 'storedGr') {
saved = dojo.fromJson(localStorage.getItem(localStorage.key(i)));
var graphic = new esri.Graphic(saved);
graphic.setAttributes({
"ID": n,
"LSNo": i
});
userGraphics.add(graphic);
}
}
userGraphics is a graphics layer just for the, well, user graphics! - this means other stuff the system adds, like markers, and highlights, don't get mixed up. Finally the delete from local storage, when a user deletes the graphics. This needs this added to the create toolbar event thingy
function createToolbarAndContextMenu(map) {
map.enableSnapping({
snapKey: dojo.keys.copyKey
});
// Create and setup editing tools
editToolbar = new esri.toolbars.Edit(map);
dojo.connect(editToolbar, "onDeactivate", function(tool, graphic, info) {
//we need to remove the version in local storage as we will be saving a new version
//if Graphics has newID it has been added this session
//If not it has been loaded from localstorage
//if from LS the attribute LSNo will equal the index no in localstorage
if (graphic.attributes.newID) {
localStorage.removeItem(graphic.attributes.newID);
} else {
localStorage.removeItem(localStorage.key(graphic.attributes.LSNo));
}
//save a new version with name time stamped so it can be referred to in future edits/deletes this session
var now = new Date();
var n = now.getTime();
GraphicName = "storedGraphic" + n;
window.localStorage.setItem(GraphicName, dojo.toJson(graphic.toJson()));
});
dojo.connect(map, "onClick", function(evt) {
editToolbar.deactivate();
});
createMapMenu();
createGraphicsMenu();
}
I think the comments say enough - basically we need a common naming system for the graphics so they can be deleted. Finally, as I use the right click context menu form an example, I alter the delete part of that.
function createGraphicsMenu() {
// Creates right-click context menu for GRAPHICS
ctxMenuForGraphics = new dijit.Menu({});
ctxMenuForGraphics.addChild(new dijit.MenuItem({
label: "Edit",
onClick: function() {
if (selected.geometry.type !== "point") {
editToolbar.activate(esri.toolbars.Edit.EDIT_VERTICES, selected);
} else {
alert("Not implemented");
}
}
}));
ctxMenuForGraphics.addChild(new dijit.MenuItem({
label: "Move",
onClick: function() {
editToolbar.activate(esri.toolbars.Edit.MOVE, selected);
}
}));
ctxMenuForGraphics.addChild(new dijit.MenuItem({
label: "Rotate/Scale",
onClick: function() {
if (selected.geometry.type !== "point") {
editToolbar.activate(esri.toolbars.Edit.ROTATE | esri.toolbars.Edit.SCALE, selected);
} else {
alert("Not implemented");
}
}
}));
ctxMenuForGraphics.addChild(new dijit.MenuSeparator());
ctxMenuForGraphics.addChild(new dijit.MenuItem({
label: "Delete",
onClick: function() {
userGraphics.remove(selected);
if (selected.attributes.newID) {
localStorage.removeItem(selected.attributes.newID);
} else {
localStorage.removeItem(localStorage.key(selected.attributes.LSNo));
}
}
}));
ctxMenuForGraphics.startup();
dojo.connect(userGraphics, "onMouseOver", function(evt) {
// We'll use this "selected" graphic to enable editing tools
// on this graphic when the user click on one of the tools
// listed in the menu.
selected = evt.graphic;
// Let's bind to the graphic underneath the mouse cursor
ctxMenuForGraphics.bindDomNode(evt.graphic.getDojoShape().getNode());
});
dojo.connect(userGraphics, "onMouseOut", function(evt) {
ctxMenuForGraphics.unBindDomNode(evt.graphic.getDojoShape().getNode());
});
}
Looking at it now, I am not too sure how it all works!! It was a few months ago I did it and my memory isn't as good as it used to be. So please take it as it is. Cheers ACM
... View more
08-05-2013
02:19 AM
|
0
|
0
|
2926
|
|
POST
|
Hi I have code that writes all stuff created with the draw toolbar to HTML5 local storage, and then reads it back next time a user uses the site. Is that the sort of thing you are after? As mine is for an internal site I have control over browser versions, so this works OK. ACM
... View more
08-03-2013
11:36 PM
|
0
|
0
|
2926
|
| 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 |
Tuesday
|