POST
|
Shaikh, Following are the functions to add/remove custom link/button into the info window. Include these functions into the search widget's widget.js. and define onClick handler (_onCustomAction). _addAction: function(){
var link = domConstruct.create("a",{
"class": " action my-action", //give it a unique class
"id": "customAction",
"innerHTML": "My Action", //text that appears in the popup for the link
"href": "javascript: void(0);"
}, query(".actionList", this.map.infoWindow.domNode)[0]);
//when the link is clicked register a function that will run
on(link, "click", this._onCustomAction);
}
_removeAction: function() {
//to remove either store "link" var into a global or get it by class using dojo/query
query(".my-action", this.map.infoWindow.domNode).forEach(function(elem){
elem.destroy();
})
} Call this _addAction method in "_onSearchResults" method inside Search widgets's widget.js. Hopefully this should do what you want. Thanks, Girish
... View more
07-31-2016
11:19 PM
|
1
|
8
|
2243
|
POST
|
Adolfo, The workflow you a looking for is very much possible. You can either modify the existing WAB Edit widget or create your own custom widget. In WAB Edit widget you can suppress Attribute Inspector popping up after draw by setting "disableAttributeUpdate" config param to true. But, this widget make use of ArcGIS JS API's Editor widget which deactivates after draw complete. You can activate it programmatically again, but creating a custom widget will give you more flexibility and control. Therefore, in custom widget do not use ArcGIS API's Editor widget, rather you can use DrawToolbar and TemplatePicker to achieve this simplified editing workflow. Here is a sample for this: Edit without editor widget | ArcGIS API for JavaScript 3.17 -Girish
... View more
07-29-2016
02:46 AM
|
1
|
0
|
461
|
POST
|
Hi cadgis m, Sorry for the late reply, I saw this post just now. I don't know whether you have figured out the solution or not, but as this question is not yet marked as answered, I will put in my thoughts... Is the Spatial reference of the input Graphic same as the spatial reference of Layer 2? looks like you are making a query to Layer1 and inserting the returned graphic into Layer2. One thing to remember here is that the query does take "outSR" param as input and if its not specified then the returned graphics will be in Map SR (mostly 102100). And if Layer2 has different SR then map's SR then the graphic will get added into the layer but it will be displaced (or not visible). Therefore, either 1. reproject graphics geom into Layer2's SR and then do ApplyEdits OR 2. set "outSR" into your query to match Layer2's SR, (but in this case adding graphic to map will not show graphic to the correct place). -Girish
... View more
07-29-2016
12:55 AM
|
0
|
0
|
1510
|
POST
|
Hi Antoine, Yes, you can add any layer (that is supported by ArcGIS JS API) to the Map object in WAB app the same way you do it using ArcGIS JS API. If you want to add layer into the map at app startup then put your code in the widget that is configured as "WidgetOnScreen". and put your code to add layer in widget's postCreate or startup function. (can also specify the layer url in the widgets config). Every widget inherited from "jimu/BaseWidget" does have reference to the map object. You can simply add any layer into this. To make REST service requests from the WAB use "esri.request" or "dojo/request" or any other JS request handler. Thanks, Girish
... View more
07-28-2016
01:29 PM
|
2
|
0
|
1803
|
POST
|
Hello Everyone, I have a REST SOE developed on .NET for ArcGIS for Server 10.3.1. Now, from SOE, I want to write couple of files to ArcGIS Server server directories (a custom server directory OR arcgisoutput OR arcgisjob ). How to access these directories? Inside interfaces ESRI.Arcgis.Server.IServerObjectManager and ESRI.Arcgis.Server.IServerEnvironmentExt there is a method GetServerDirectoryInfos() which returns the info that I need but I could not yet figure out how to use these interfaces. Note: I can get the server directories path by digging into the registry for AGS installation drive and then by appending "/arcgisserver/directories/...". But, it would be neat if I can get IServerDirectoryInfo which gives the directory url as well. Any suggestions? Thanks, Girish
... View more
07-26-2016
02:27 PM
|
0
|
0
|
870
|
POST
|
Tyler, The infoTemplate that you are creating does not have correct parameters. It takes only two parameters (title, content). There are extra "," inside contents: infoTemplate: new InfoTemplate("Address: ${ADDRESS}", "Address Type: ${PT_TYPE}</br>Address: ${ADDRESS}</br>City: ${CITY}", "State: ${STATE}</br>Zipcode: ${ZIPCODE}","Business Name: ${BUS_NAME}</br>Business Type: ${BUS_TYPE}</br>Landuse: ${LANDUSE}", "Zoning: ${ZONING}</br>Ward: ${WARD}", "Subdivision Name: ${SUBDIVISIO}</br>Development Name: ${DEV_NAME}"), Use it like this: new InfoTemplate("Search Results", "Address: ${ADDRESS}</br>Address Type: ${PT_TYPE}</br>Address: ${ADDRESS}</br>City: ${CITY}</br>State: ${STATE}</br>Zipcode: ${ZIPCODE}</br>Business Name: ${BUS_NAME}</br>Business Type: ${BUS_TYPE}</br>Landuse: ${LANDUSE}</br>Zoning: ${ZONING}</br>Ward: ${WARD}</br>Subdivision Name: ${SUBDIVISIO}</br>Development Name: ${DEV_NAME}"), -Girish
... View more
01-19-2016
05:54 PM
|
1
|
0
|
680
|
POST
|
There is no in-built method to reorder the graphics, But, as Layer.Graphics is an array, we can manipulate it with javascript array methods. Sure, you can also use remove/add graphics, but the way I prefer is this: Array.prototype.reorder = function (fromIndex, toIndex){
this.splice(toIndex, 0, this.splice(fromIndex, 1)[0]);
}
//an example
var a = [1,2,3,4,5];
a.reorder(3, 0);
console.log(a)
//a is now [4,1,2,3,5] This is added as an extension method, therefore it can be used with any array in your app. However, if you just want to use it in one place then simply use one line that is inside the function. -Girish
... View more
01-19-2016
04:48 PM
|
0
|
1
|
585
|
POST
|
There is a method in Map class to change the layer order. Map | API Reference | ArcGIS API for JavaScript -Girish
... View more
01-19-2016
11:37 AM
|
0
|
3
|
1993
|
POST
|
Shawn, I would suggest, its better and much easier way to print map using ArcGIS JS API's PrintTask. PrintTask | API Reference | ArcGIS API for JavaScript PrintParameters | API Reference | ArcGIS API for JavaScript Just pass in the map object with PrintParameters and set other parameters accordingly. The API will take care of everything and you need not to create webMap JSON. -Girish
... View more
01-19-2016
01:53 AM
|
1
|
0
|
544
|
POST
|
Guangyu, Search dijit does support map/feature service feature layer. and according to ArcGIS JS API documentation: "Suggestions are available if working with a 10.3 geocoding service that has suggest capability loaded or a 10.3 feature layer that supports pagination, i.e. supportsPagination = true" Now, for pagination support check this out: How do you enable the "Supports Pagination" on a layer at 10.3? Hopefully this will help. -Girish
... View more
01-18-2016
11:30 PM
|
1
|
0
|
266
|
POST
|
Ondrej, If the layer is GraphicsLayer or FeatureLayer then simply use .setRenderer(renderer) method to change the renderer. FeatureLayer | API Reference | ArcGIS API for JavaScript And if its ArcGISDynamicServiceMapLayer then you need to use .setLayerDrawingOptions() method. ArcGISDynamicMapServiceLayer | API Reference | ArcGIS API for JavaScript -Girish
... View more
01-18-2016
11:13 PM
|
1
|
2
|
2178
|
POST
|
cadgis m, Are you passing the graphic object directly to ApplyEdits? I guess that would cause it not to save because If you directly fetch feature out from FeatureLayer then it has few properties that are referenced to its parent feature layer. Try to get the JSON from the graphic and create a new Graphic using that JSON and save this new graphic to Layer2. var newFeature = new Graphic(graphic.toJson()); featureLayer.applyEdits([newFeature], null, null) you can also update the attributes of the newFeature before applying edits. -Girish
... View more
01-18-2016
10:51 PM
|
1
|
3
|
1510
|
POST
|
Mike, This is because, by default the infoWindow pops up on Map's onClick event. and it uses some buffer while selecting points. Now, if you want to disable this default behavior, use following: map.setInfoWindowOnClick(false); AND to show the infoWindow on Layer's OnClick event: featureLayer.on('click', function(evt) {
alert('on-click');
map.infoWindow.setFeatures([evt.graphic]);
map.infoWindow.show(evt.screenPoint, map.getInfoWindowAnchor(evt.screenPoint));
}); -Girish
... View more
01-17-2016
03:45 AM
|
3
|
0
|
338
|
POST
|
Hi Priya, You need to use dojo's lang.hitch on _showResults function call to set the execution scope. include "dojo/_base/lang" AND onLoadBndry: function() { ... ... queryTask.disableClientCaching = true; queryTask.useAMF = false; queryTask.showBusyCursor = true; queryTask.execute(query, lang.hitch(this, this._showResults)); }, You might have to do this for call to _updateMemoryStore as well this.watch("results", lang.hitch(this, this._updateMemoryStore)); -Girish
... View more
01-17-2016
01:47 AM
|
2
|
0
|
310
|
POST
|
Nadir, Check out the AttachmentEditor in ArcGIS API for Javascript. It does exactly what you want. Its also embedded in Editor dijit. -Girish
... View more
01-17-2016
01:33 AM
|
1
|
0
|
353
|
Title | Kudos | Posted |
---|---|---|
1 | 01-05-2016 09:37 PM | |
1 | 07-29-2016 02:46 AM | |
1 | 01-11-2016 01:56 PM | |
1 | 01-19-2016 01:53 AM | |
1 | 01-19-2016 05:54 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|