|
POST
|
Say I have an event handler in my custom widget that handles a map click and executes an identify task. Within the event handler function and also the callback function for the identify.execute function I would like to reference the widget. Using the "this" keyword doesn't give the widget, it gives the event object or the window object. The code below shows how I'm doing this, but I think this is not the right way. _handleMapClick: function (event) { var identifyTask = new IdentifyTask(url); var identifyParams = new IdentifyParameters(); var layerQuery = new Query(); identifyParams.tolerance = 3; identifyParams.returnGeometry = true; identifyParams.layerIds = [159]; identifyParams.layerOption = IdentifyParameters.LAYER_OPTION_VISIBLE; identifyParams.width = landIdWidget.map.width; identifyParams.height = landIdWidget.map.height; identifyParams.geometry = event.mapPoint; identifyParams.mapExtent = landIdWidget.map.extent; identifyTask.execute(identifyParams, function (response) { layerQuery.where = "ID = " + parId; deferred = landIdWidget.that._myFeatureLayer.selectFeatures(layerQuery, FeatureLayer.SELECTION_NEW, function (selected) { landIdWidget.that._showParcelInfo(selected); }); } } }); }
... View more
09-30-2015
02:43 PM
|
0
|
2
|
3093
|
|
POST
|
Thanks, Xiaodong. You are correct and I was being forgetful. I was forgetting to click Save after setting the config in my app.
... View more
09-10-2015
08:28 PM
|
0
|
0
|
761
|
|
POST
|
The previous version (1.2) of WAB stored the widget configs in this folder. The latest version (1.3) has a folder called "loading" in it and in there is a folder called images and a loading.css file. Where is my widget config file now?
... View more
09-10-2015
03:12 PM
|
0
|
2
|
3597
|
|
POST
|
I'm trying to get a popup to display on a selection-complete event of a feature layer. I'm having a problem where at the line to show the window I get a "Cannot read property 'toScreen' of undefined" error in the console. Does anyone know of a better way of showing a popup from a 'selection-complete' event? Thanks. featureLayer.on("selection-complete", showInfo); function showInfo (event) { map.infoWindow.setFeatures(event.features); map.infoWindow.show(map.extent.getCenter()); } Message was edited by: Andrew Terwiel I have it working now. Code snippets below. postCreate: function () { this.inherited(arguments); this._config = this.config; this.map = this.map; this.map.infoWindow = this._customPopup; this.map.on("click", this._showRoadInfo); }, deferred = widget._roadFeatureLayer.selectFeatures(layerQuery, FeatureLayer.SELECTION_NEW, function (selected) { widget._roadFeatureLayer.setSelectionSymbol(widget._slsRoad); widget._parcelFeatureLayer.clearSelection(); widget._zoomToRoad(selected, widget); var mpPt = selected[0].geometry.getExtent().getCenter();//new Point(-122, 45.6); var scrPt = widget.map.toScreen(mpPt); widget.map.emit("click", { selected: selected, map: widget, bubbles: true, cancelable: true, screenPoint: scrPt, mapPoint: mpPt }); }); _showRoadInfo: function (event) { var that = this._mapParams.infoWindow; that.setFeatures(event.selected); that.show(event.mapPoint, event.screenPoint); },
... View more
08-23-2015
06:40 PM
|
0
|
2
|
3447
|
|
POST
|
Thanks, Robert. I ended up altering the init.js file like so: dojoConfig = { parseOnLoad: false, async: true, tlmSiblingOfDojo: false, has: { 'extend-esri': 1 }, packages : [{ // this is the package I added name : "cbtree", location : window.path + "libs/cbtree" }] };
... View more
08-03-2015
04:18 PM
|
0
|
0
|
1565
|
|
POST
|
Hi Robert, Thanks for you help. The problem I have with the sample is that I'm getting these errors: - GET http://localhost:62919/setting/cbtree/Tree 404 (Not Found) - Uncaught Error: xhrFailed I believe the path to cbtree/Tree is correct, so I can't see why I get that error. On Mon, Jul 20, 2015 at 10:45 PM, Robert Scheitlin, GISP <geonet@esri.com>
... View more
07-20-2015
02:20 PM
|
0
|
1
|
1565
|
|
POST
|
Hi Robert, I've tried some of the demos here: cbtree/demos/store at master · pjekel/cbtree · GitHub Couldn't get them to work though. Searching Stackoverflow and Geonet for discussions about the cbtree is a joyless experience. I think maybe one question was posted on Stackoverflow. I'm coming to the conclusion that this is not a well used and tested object.
... View more
07-19-2015
09:51 PM
|
0
|
3
|
1565
|
|
POST
|
I've been trying to create a checkbox tree in my settings for a widget. The checkbox tree docs are here: http://thejekels.com/dojo/cbtree_AMD.html To get the data into the tree I'm using the code below. The data array is not what I'll be using in the end product. The problem I'm having is that the data property of the store is always null. The _jsonData property of the store object has the array in it though. Can anyone see what I'm doing wrong? var data = [{ id: "earth", name: "The earth", type: "planet", population: "7 billion" }]; //var data = result; var store = new ItemFileWriteStore({ data: data }); var model = new ForestStoreModel({ store: store, query: { id: "earth" }, rootLabel: "Layers", checkedRoot: true }); var tree = new Tree({ model: model, id: "MenuTree", branchIcons: true, branchReadOnly: false, checkBoxes: true, nodeIcons: true }); Message was edited by: Andrew Terwiel I think I need to call fetch() on the store before using it in the model. Message was edited by: Andrew Terwiel I've made some progress. The following code will display a rudimentary tree, as shown. The checkboxes don't show for some reason and I can't get the parent-child hierarchy to display. var layers = {}; layers.label = 'name'; layers.identifier = 'name'; layers.items = [ { name: "Family", type: "root" }, { name: "Abe", type: "parent", parent: ["root"], hair: "Brown" }, { name: "Jacqueline", type: "parent", parent: ["root"], hair: "Brown" }, { name: "Homer", type: "parent", parent: ["Abe"], hair: "none" }, { name: "Marge", type: "parent", parent: ["Jacqueline"], hair: "blue" }, { name: "Bart", type: "child", parent: ["Homer", "Marge"], hair: "blond" }, { name: "Lisa", type: "child", parent: ["Homer", "Marge"], hair: "blond" }, { name: "Maggie", type: "child", parent: ["Homer", "Marge"], hair: "blond" } ]; var store = new ItemFileWriteStore({ data: layers }); var model = new ForestStoreModel({ store: store }); var tree = new Tree({ model: model, id: "MenuTree" }); connect.connect(tree, "onCheckBoxClick", model, that._checkBoxClicked); tree.placeAt(that.checkboxTreeDiv);
... View more
07-14-2015
04:47 PM
|
0
|
7
|
4604
|
|
POST
|
Hi Nathaniel. As I stated earlier, in reply to one of Robert's posts, this occurs even on a fresh web appbuilder installation.
... View more
07-13-2015
03:50 PM
|
1
|
1
|
2735
|
|
POST
|
No. It began as an intermittent problem, but has now escalated to a constant one. Do you think it could be anything to do with our corporate proxy? On Mon, Jul 13, 2015 at 11:51 PM, Robert Scheitlin, GISP <geonet@esri.com>
... View more
07-13-2015
03:48 PM
|
0
|
0
|
2735
|
|
POST
|
Hi Robert, That's what it looked like to me too. However, even a fresh installation of web appbuilder on my PC produces the same issue.
... View more
07-12-2015
07:46 PM
|
0
|
2
|
2735
|
|
POST
|
Can anyone please help me find out what is causing this problem? When I try to save a webapp that I've created in Web Appbuilder I get this message: "Failed to save app". The Chrome developer tools console show these errors: POST http://dpc0159.civic.npdc.govt.nz:3344/webappbuilder/rest/apps/2/saveconfig 502 (Proxy Error ( The specified network name is no longer available. ))k @ init.js:162(anonymous function) @ main.js:1586k @ init.js:199m @ init.js:199f.resolve @ init.js:201(anonymous function) @ init.js:815k @ init.js:199m @ init.js:199f.resolve @ init.js:201a @ init.js:200k @ init.js:200m @ init.js:199f.resolve @ init.js:201a @ init.js:200k @ init.js:200m @ init.js:199f.resolve @ init.js:201a @ init.js:200k @ init.js:200m @ init.js:199f.resolve @ init.js:201q @ init.js:160f @ init.js:164 main.js:1551 SyntaxError: Unexpected token < at Object.parse (native) at a.json (http://js.arcgis.com/3.13/init.js:242:182) at n (http://js.arcgis.com/3.13/init.js:240:340) at q [as handleResponse] (http://js.arcgis.com/3.13/init.js:160:111) at XMLHttpRequest.f (http://js.arcgis.com/3.13/init.js:164:201) I've tried debugging and watching various objects, but I can't see what the cause is.
... View more
07-12-2015
05:22 PM
|
1
|
9
|
6125
|
|
POST
|
Thanks, Robert. You put me on the right track. I ended up using the formatter function like so: var linksData = [ { link: '<span class="glyphicon glyphicon-circle-arrow-right"></span> DP Plans' }, { link: '<span class="glyphicon glyphicon-circle-arrow-right"></span> T1 Land' }, { link: '<span class="glyphicon glyphicon-circle-arrow-right"></span> T1 Property' } ]; var linksGrid = new Grid({ showHeader: false, className: "dgrid-autoheight", columns: { link: { label: 'link', formatter: function (item) { return item; } } } }); This has made the browser render the span element correctly so that I get a nice little icon next to my link text.
... View more
07-07-2015
03:17 PM
|
1
|
0
|
1176
|
|
POST
|
Does anyone know how I can get html to render in a dgrid column? This is what I'm trying to do: var linksData = [ { link: '<span class="glyphicon glyphicon-info-sign"></span> DP Plans' }, { link: 'T1 Land' }, { link: 'T1 Property' } ]; var linksGrid = new Grid({ showHeader: false, className: "dgrid-autoheight", columns: { link: 'link' } }); linksGrid.renderArray(linksData); The result of this code is that I see the literal string in the first row's column. I'd like the html to be rendered by the browser.
... View more
07-06-2015
09:51 PM
|
0
|
2
|
4478
|
|
POST
|
I've found the cause. I need to hide the infoContainerDiv when the widget opens, so I have this line of code: query(this.infoContainerDiv, self).style('display', 'none'); I then want to show the infoContainerDiv after a typeahead suggestion has been selected, so I have this line of code: query(this.infoContainerDiv, this.domNode).style('display', ''); Removing both of these fixes the display problem. Now I just need to find a better way of hiding and displaying the infoContainerDiv.
... View more
07-02-2015
05:40 PM
|
1
|
1
|
1846
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-27-2016 01:34 PM | |
| 1 | 05-13-2015 09:27 PM | |
| 1 | 06-09-2015 03:18 PM | |
| 1 | 06-24-2015 06:22 PM | |
| 1 | 07-07-2015 03:17 PM |
| Online Status |
Offline
|
| Date Last Visited |
03-22-2021
03:45 PM
|