|
POST
|
Hi Am I missing something, but according to the API notes there appears to be no events for the overview map. What i am wanting to do is when a user hides the overview map, a cookie/local storage thingy is written with the map status. This will then get read in next time they use the page. But I can't seem to find any events to hang the code from Cheers ACM
... View more
04-23-2013
06:54 AM
|
0
|
5
|
1850
|
|
POST
|
Hi - I'm having issues with this too - I've tried map.removeLayer(map.layers[0]); (The layer I want to remove is index 0) This results in[ CODE] ncaught TypeError: Cannot read property '0' of undefined basecode.js:981 switchBaseMapbasecode.js:981 onClick _d66._onClickinit.js:34 _2cfinit.js:15 _b24._onClickinit.js:34 (anonymous function)init.js:15 _7bbinit.js:34 map.removeLayer('mainmap'); The gives no errors, but doesn't do anything, the layer is still showing if I Look at console.debug(map) Cheers ACM
... View more
04-22-2013
01:58 AM
|
0
|
0
|
2583
|
|
POST
|
Have you linked in the expandopane CSS? http://serverapi.arcgisonline.com/jsapi/arcgis/3.3/js/dojo/dojox/layout/resources/ExpandoPane.css the Style isn't in the main CSS. ACM
... View more
04-19-2013
08:17 AM
|
0
|
0
|
2952
|
|
POST
|
Anyone know a way to add a "no color" option to the Dojo ColorPalette - it looks like the Dojo community cannot see a point http://bugs.dojotoolkit.org/ticket/5774 - us GIS people know how useful that would be. Cheers ACM
... View more
04-18-2013
02:44 AM
|
0
|
0
|
494
|
|
POST
|
sorted - thanks - I must have read the API notes several times without noticing it said feature. Cheers ACM
... View more
04-18-2013
02:35 AM
|
0
|
0
|
1608
|
|
POST
|
Cheers - I'm sure I tried that, but I'll have another go. Thanks ACM
... View more
04-18-2013
12:32 AM
|
0
|
0
|
1608
|
|
POST
|
Ah, do I understand correctly then, that the snapping only works on feature layers added to the map? I guess so Reference to a feature or graphics layer that will be a target snapping layer. The default option is to set all feature and graphics layers in the map to be target snapping layers. If so it would explain a lot as I have no feature layers, just dynamic ones. So, if I add a feature layer to the map - does it have to be visible? Cheers ACM
... View more
04-17-2013
09:29 AM
|
0
|
0
|
1608
|
|
POST
|
Hi I have a internal project about to go live, I really want to have snapping for measurements and user added graphics. At the moment a simple map.enableSnapping({ snapKey: dojo.keys.copyKey }); gets it on. However snapping only appears to work against already drawn graphics, not on any of my vector layers on my map. My map is made up of four ArcGISDynamicMapServiceLayer - added like this var background = new esri.layers.ArcGISDynamicMapServiceLayer(mapservice1, { "id": "mainbasemaps" }); // map.addLayer(background); background.setDPI(150); var altmaps = new esri.layers.ArcGISDynamicMapServiceLayer(altbasemaps, { "id": "altbasemaps" }); // map.addLayer(altmaps); var aerials = new esri.layers.ArcGISDynamicMapServiceLayer(aerialservice, { "id": "aerialmaps" }); //map.addLayer(aerials); dynamicMapServiceLayer = new esri.layers.ArcGISDynamicMapServiceLayer(mapservice2, { "id": "mainmap" }); dynamicMapServiceLayer.setOpacity(0.9); dynamicMapServiceLayer.setDPI(96) map.addLayers([background],[altmaps],[aerials],[dynamicMapServiceLayer]); from the API documentation Reference to a feature or graphics layer that will be a target snapping layer. The default option is to set all feature and graphics layers in the map to be target snapping layers. So I would have thought it would snap to everything? I've tried defining a specific layer like var snappinglayer = new esri.layers.FeatureLayer(mapservice2 + "/4", { mode: esri.layers.FeatureLayer.MODE_ONDEMAND, outFields: ["*"] }); ... var layerInfos = [{ layer: snappinglayer }]; snapManager.setLayerInfos(layerInfos); But that fails. Any ideas what I've missed? ACM
... View more
04-17-2013
06:13 AM
|
0
|
6
|
2375
|
|
POST
|
HI I have this chunk of code that sets the snapping environment to a specific sublayer in a map service
var snappinglayer = new esri.layers.FeatureLayer(mapservice1 + "/6", {
mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
outFields: ["*"]
});
var snapManager = map.enableSnapping({ snapKey: dojo.keys.copyKey });
snapManager.tolerance=15;
var layerInfos = [{ layer: snappinglayer }];
snapManager.setLayerInfos(layerInfos);
When the CTRL key is held down whilst drawing a new polygon, I get the default blue cross on the required layer, but the drawing doesn't snap to it at all [ATTACH=CONFIG]22690[/ATTACH] See image. If I remove the layer requirements the new drawing polygon will ONLY snap to previously drawn user graphics. But it does work exactly as it should. Prior to patching with SP1 the time taken for the blue cross to move on my required layer was painful. With SP1 it at least moves at a OK speed, but simply doesn't snap Have I missed something? Cheers ACM
... View more
03-18-2013
04:33 AM
|
0
|
0
|
975
|
|
POST
|
Sorted it all by myself 😄 I needed to assigned IDs to the graphics as they were being read in, with the stored localstorage index, so;
for (var i = 0; i < localStorage.length; i++) {
var n= "SavedGraphic" + i
saved = dojo.fromJson(localStorage.getItem(localStorage.key(i)));
console.debug(localStorage.getItem(localStorage.key(i)))
var graphic = new esri.Graphic(saved);
graphic.setAttributes({ "ID": n,"LSNo":i });
userGraphics.add(graphic);
}
This gives each graphic that is loaded in for a new session a attribute (LSNo) that equals the index in localstorage. Then I need to delete the store when it is edited - I also need to delete the store if it is a new graphic, added that session. So in the createToolbarAndContextMenu function (I'm using the function from (http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/graphics_contextmenu.html) dojo.connect(editToolbar, "onDeactivate", function (tool, graphic, info) {
if (graphic.attributes.newID) {
localStorage.removeItem(graphic.attributes.newID)
}
else {
localStorage.removeItem(localStorage.key(graphic.attributes.LSNo))
}
var now = new Date();
var n = now.getTime();
GraphicName = "storedGraphic" + n
window.localStorage.setItem(GraphicName, dojo.toJson(graphic.toJson()));
}); Having added graphic.setAttributes({ newID: GraphicName }) To the addToMap function. So if the graphic has been added because it was saved before or if it was added in that session the delete from localstorage is treated differently. For previously saved the index is used. For newly added the id is used. Finally, to the createGraphicsMenu function, the delete section, I add userGraphics.remove(selected); if (selected.attributes.newID) {
localStorage.removeItem(selected.attributes.newID)
}
else {
localStorage.removeItem(localStorage.key(selected.attributes.LSNo))
} That does the same for deletions. I'm sure there is a tidier way, bu this appears to work.
... View more
03-15-2013
06:09 AM
|
1
|
0
|
827
|
|
POST
|
Ah found it - I knew I'd seen this thread - however I found it too late - I posted a new one http://forums.arcgis.com/threads/79938-Save-load-graphics-to-loacl-storage In it I show how I am writing and reading from local storage, but need some pointers on editing/deleting Cheers ACM
... View more
03-15-2013
04:55 AM
|
0
|
0
|
1144
|
|
POST
|
I'm sure I was subscribed to a thread about this, but can't find it, so sorry, starting a new one. I've got some code (that I've added to one of the samples here.) that uses the HTML5 local storage and then retrieving it on next login. (in total 10 lines of code, so I am quite pleased with my self, seeing this morning I had never used localstorage before) This works fine, but I am now stuck over how to make any edits made to over-write the localstorage version of that option (including deletes) - obviously as it is read in some sort of unique ID needs to be assigned then used later on the edit - in my real app I use the right click context menu editing feature. Any help appreciated. Cheers ACM
... View more
03-15-2013
02:47 AM
|
0
|
1
|
2931
|
|
POST
|
sorry please ignore - didn't notice forum I was posting in
... View more
03-15-2013
02:39 AM
|
0
|
0
|
1500
|
|
POST
|
😄 There are some benefits in being an untrained hack - I never notice if I have a horrid mixture - you should see some of the javascript/.asp pages I have done in the past - a total mix of syntax. I can remember having issues over this, but can't recall the specifics, it was a long time ag (well last year sometime)
... View more
02-27-2013
06:09 AM
|
0
|
0
|
2711
|
|
POST
|
Hi Using esri.symbol.SimpleMarkerSymbol and esri.symbol.TextSymbol to allow users to add points and text - however if the text is set to, say, 12pt, it stays at 12 pt, even when zoomed out. Is it possible to have te equivalent setting to ArcMap's "Scale Symbol" option - so it is as if the text or point are spray painted onto the ground and get smaller as you zoom out - like any other feature? Cheers ACM
... View more
02-27-2013
05:11 AM
|
0
|
0
|
813
|
| 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
|