POST
|
Hi Jacqueline - sorry for the delay in my reply - I only work on this part time and it has taken a while to look through what you suggested, but the good news is that it has lead me to my answer. Looking at the code from the Save Session widget, I could see that the answer was to assign 'this' to the widget outside of the onload function so I could then transfer the code to update the bookmarks inside the onload function and reference the widget without using 'this' in there as that was just pointing to the FileReader. I've still got a lot to do, but below is the bit of working code... Thanks for your help! _onLoadBtnClicked: function() {
var result = "",
toLoad = null,
me = this,
file = fileInput.files[0],
reader = new FileReader();
reader.onload = function(e){
result = reader.result;
try {
toLoad = JSON.parse(result);
me.bookmarks = toLoad;
me.showBookmarks();
}catch (e){
alert("This is not a valid Bookmarks file")
}
}
reader.readAsText(file);
},
... View more
07-12-2017
06:49 AM
|
2
|
0
|
774
|
POST
|
I just started to convert my flex web application into a JavaScript one and I am having some difficulty with a piece of functionality I am trying to add to the Enhanced Bookmark Widget - namely to allow the user to load a list of bookmarks via a saved JSON file. I have added a 'Load' button and when it is clicked it reads in the user's chosen file but then I am stuck. Having tried various things, I think what I need to do is something like the below code. Specifically, I haven't got the hang of passing my result out to the new BookmarkListView - the result just becomes 'undefined'. Can anyone point me in the right direction as to how I need to reference as mybookmarkarray to make it the result of the FileReader? _onLoadBtnClicked: function() {
var file = fileInput.files[0];
var reader = new FileReader();
reader.readAsText(file);
reader.onload = function(e){
result = reader.result;
try{
JSON.parse(result);
}
catch (e){
alert("This is not a valid Bookmarks file")
}
console.log(JSON.parse(result));
//I checked the result and it is good but...
//How do I pass result from here
}
domConstruct.empty(this.bookmarkListBody);
this.bookmarkListView = new BookmarkListView({
mybookmarkarray: //to here
eBookmarkWidget: this,
config: this.config,
map: this.map,
nls: this.nls
}).placeAt(this.bookmarkListBody);
}, Thanks for any help.
... View more
07-05-2017
07:05 AM
|
0
|
2
|
1665
|
POST
|
I still haven't completely got there, but for anyone interested to access the ChoiceList I have put the following in the initialise function followed by the result handler below. var taskinfoRequest:JSONTask = new JSONTask();
var urlVars:URLVariables = new URLVariables();
urlVars.f = "json";
taskinfoRequest.url = gp.url;
taskinfoRequest.execute(urlVars, new AsyncResponder(taskinfoRequest_resultHandler, taskinfoRequest_faultHandler));
private function taskinfoRequest_resultHandler(taskInfo:Object, token:Object=null):void
{
var List:String = JSON.stringify(taskInfo.parameter[2].choiceList);
Alert.show(List);
}
... View more
04-14-2016
06:39 AM
|
0
|
0
|
358
|
POST
|
Hi Tina, Ok. I'm not sure I fully understand what you need. We run a number of models from python scripts as scheduled tasks each night to update data needed for our web application, but they work like I mentioned above and then the .py file is run via a .cmd file like this: start c:\python27\arcgis10.1\python.exe "E:\GIS_Scripts\python\Script.py" I'm guessing I don't have experience of what you need. I hope you get some answers here. Rebecca
... View more
04-14-2016
02:06 AM
|
0
|
0
|
929
|
POST
|
Tina, I'm not an expert but I import the toolbox and then run the model processes separately e.g. if I were to use the Create Routes tool from the Linear Referencing toolbox I would do something like: arcpy.ImportToolbox("C://path/to/Toolbox.tbx") arcpy.CreateRoutes_lr(pathtoLayertoCreateRoutesfrom, "ROUTE_ID", pathtoCreatedRoutes, "TWO_FIELDS", "START_", "LENGTH", "UPPER_LEFT", "1", "0", "IGNORE", "INDEX") You might be better exporting your model as python script and take a look at the result in PyScripter or similar - you can learn a lot like that. Does that help?
... View more
04-14-2016
12:31 AM
|
1
|
2
|
929
|
POST
|
I have a Geoprocessing Service - GetRouteMeasure. I want to allow the user to select different layers to process in the service via a drop down list on my widget. The drop down list needs to be populated by the Choice List for the input parameter Input_Discipline as shown below e.g. Pipelines, Roads etc. Is there a way to do this? Thank you
... View more
04-13-2016
08:51 AM
|
0
|
1
|
4214
|
POST
|
Ah, that'll be why I can't find it! You've saved me a lot of searching. I'm satisfied that the result we have will work even if it isn't optimal - it's certainly a major improvement on no highlight. Thanks for your help again. Best wishes, Rebecca
... View more
01-05-2016
09:16 AM
|
0
|
0
|
676
|
POST
|
Hi Robert, Setting up a scheduled task to create small buffers around the lines and then setting these up as you suggest has worked - the lines are now highlighted when the user clicks - thanks for this guidance. There is one remaining issue - the buffer has to be quite small to work well, but this makes the highlight quite difficult to see. Is there a way to change the highlight style so that it has more weight? Thanks again, Rebecca
... View more
01-05-2016
01:26 AM
|
0
|
2
|
676
|
POST
|
Hi Robert, As ever, thanks for the help. I've just returned from Christmas and New Year holidays and have the usual pile up of emails to get through, but as soon as I clear the decks I will have a go at this and let you know how I get on. Update: ok, I've taken a look at your solution and unfortunately we deal almost exclusively in polylines. A bit more info. We have a standalone dynamic service published called Attributes which is solely used for the attribute table - as explained this is because our main services are just too complex to work with for the Attribute Table. This simplified service has 6 layers - 5 are lines and one is a point dataset. I tried what you suggested with the point layer, by making it null inside and an outline width = 0 and that has done the trick with that particular layer. I'm thinking if I can set up a scheduled task that buffers the lines a tiny bit then I can use those as my data for the service it could possibly work. I'll look into that and see how I get on. Thanks, Rebecca
... View more
01-04-2016
01:06 AM
|
0
|
0
|
676
|
POST
|
I have an issue with the Attribute Table widget that I am stumped on. Any ideas would be much appreciated. We have a very large numbers of layers in our 5 maps services (just over 200) - only 5 of these are needed in the Attribute Table. To exclude out all the unwanted layers is cumbersome and doesn't work past a certain number of layers, plus we would like some of the layers (that are defined into pipeline types in the application to appear as one tab called Pipelines). My solution to this was to create another service with just the 5 layers and publish that and then just exclude the 5 main map services and use this special one for the Attribute Table. However, users might turn off the main services and the data wouldn't disappear because it would also be visible in the special service for the Attribute Table. So we made the special service 99% transparent and that did the trick... the Attribute Table worked well, bar two issues. 1) when the user turns off the layer in the main service, the data is still visible in the attribute table 2) the highlight feature function doesn't work as I'm assuming it has the same transparency as the layer and is therefore not displaying We can live with the data being visible all the time in the table, but we really need the highlight to work as it is a busy, complex application and even though the zoom part works, you can't always tell which feature is selected. Perhaps I need a separate highlight function but I'm not sure where in the code the selected item from the datagrid is accessed and zoomed to/highlighted. I am working with the uncompiled 3.7 version. Does anyone have any suggestions for where I could start with this? Or other ideas to make this highlight work? Thanks in advance.
... View more
12-21-2015
08:30 AM
|
0
|
8
|
4017
|
POST
|
Hopefully an easy one for someone. Can you explain what the 0s mean in this code? Thanks
... View more
08-27-2015
03:27 AM
|
0
|
2
|
2430
|
POST
|
Using ArcGIS Server 10.1 I have created a service, enabled KML and published it. I have then gone to KML Network Links and created a network link using this service. I copied the URL and loaded this into Google Earth, but none of the data shows although if you double click on the layer it does zoom to the extent of the data. If I create a KMZ using the Map to KML Conversion tool this loads in fine. Can anyone suggest where I'm going wrong with the KML Network Links? Thanks.
... View more
11-25-2014
07:54 AM
|
0
|
0
|
2532
|
POST
|
Thank you Robert. I thought that I must be doing the event firing wrong so I didn't look closely enough at what the dataGridClickEvent handler was doing. The event is firing, but the dataGridClickEvent function uses event.currentTarget.selectedItem to ascertain which discipline the results are for and then shows a selection of attributes that are relevant to that discipline. When I fire the event programmatically, the event.currentTarget doesn't seem to be set so the discipline variable and all the attributes were not being assigned. So I have added myGrid.selectedIndex = 0; into the if statement (shown in my first post) and changed my dataGridClickEvent function as follows and it seems to have done the trick: private function dataGridClickEvent(event:ListEvent):void { // var discipline was being assigned like this // var discipline:String = event.currentTarget.selectedItem.Disc; //now it's being assigned like this var discipline:String = myGrid.selectedItem.Disc; aMap = new Object(); dpArray = new Array(); switch(discipline) { case "Water": // attributes were being assigned like this //aMap["Location"] = event.currentTarget.selectedItem.Loc; // now attributes are being assigned like this aMap["Location"] = myGrid.selectedItem.Loc; //then numerous other attributes are assigned for (var pkey:String in aMap) { dpArray.push({label:pkey, data:aMap[pkey]}); } initDP = new ArrayCollection(dpArray); break; //etc for the other disciplines Thanks for pointing me in the right direction again.
... View more
08-28-2014
08:21 AM
|
0
|
0
|
200
|
POST
|
I'm having some issues getting an event to fire programmatically. I have two datagrids. I execute an identifyTask from a click on the map and populate myGrid with the results. When I click on a record in myGrid, the dataGridClickEvent function is run which populates detailGrid with more detailed information. This all runs fine, but I would like it so that if there is only one result from the identifyTask, the dataGridClickEvent function runs automatically to populate detailGrid. This is the code I am using, but detailGrid is still not being populated unless I physically click on the record in myGrid. //ArrayCollection for my results initDG = new ArrayCollection(DGArray); //if the ArrayCollect has only one result if (initDG.length == 1) { myGrid.dispatchEvent(new ListEvent(ListEvent.ITEM_CLICK, false, false,0,0)); } I have also tried: dataGridClickEvent(new ListEvent(ListEvent.ITEM_CLICK, false, false ,0,0)); Can anyone tell me where I am going wrong? Thanks.
... View more
08-27-2014
08:14 AM
|
0
|
2
|
776
|
Title | Kudos | Posted |
---|---|---|
1 | 04-14-2016 12:31 AM | |
2 | 07-12-2017 06:49 AM | |
1 | 06-10-2014 02:56 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|