POST
|
Ahh, OK. In that case, it's probably not a good idea to control the layers' permission within a custom widget as the widget is quite often created later than the map. It's better setting up user permissions on the source layers of your web map. So the response of the map request doesn't contain the in-accessible layers at all. Cheers, Leo.
... View more
02-19-202003:59 PM
|
1
|
1
|
906
|
POST
|
Add this line after widget created. ccWidget . _expanded = true ;
... View more
02-18-202007:40 PM
|
0
|
1
|
1343
|
POST
|
Hi Jasmin, You can follow Rickey's suggestion to create a custom 3D widget. Make sure you have an UI with a dojo attach point in your Widget.html: < div > < div data-dojo-attach-point = " myCoordinateConversionWidget " > div > div > and then in your Widget.js, create the CoordinateConversion widget and attach it to the element by 'container' property: define ( [ 'dojo/_base/declare' , 'jimu/BaseWidget' , 'esri/widgets/CoordinateConversion' ] , function ( declare , BaseWidget , CoordinateConversion ) { //To create a widget, you need to derive from BaseWidget. return declare ( [ BaseWidget ] , { //Please note that the widget depends on the 4.0 API // DemoWidget code goes here baseClass : 'jimu-widget-demo' , postCreate : function ( ) { this . inherited ( arguments ) ; var ccWidget = new CoordinateConversion ( { container : this . myCoordinateConversionWidget , view : this . sceneView } ) ; } , startup : function ( ) { this . inherited ( arguments ) ; console . log ( 'startup' ) ; } , onOpen : function ( ) { console . log ( 'onOpen' ) ; } , onClose : function ( ) { console . log ( 'onClose' ) ; } , onMinimize : function ( ) { console . log ( 'onMinimize' ) ; } , onMaximize : function ( ) { console . log ( 'onMaximize' ) ; } } ) ; } ) ;
... View more
02-18-202005:11 PM
|
1
|
1
|
533
|
POST
|
How about this? Map | API Reference | ArcGIS API for JavaScript 3.31 Then in your widget, use this . Map . removeLayer ( YOURLAYEROBJECT ) ;
... View more
02-18-202003:56 PM
|
1
|
3
|
906
|
POST
|
Hi Piet, Is it because you need a space before AND operator in your query string? var queryParams = new PortalQueryParams ( { query : 'group:' + selectedID + ' AND type:Map' , } ) ;
... View more
02-18-202003:49 PM
|
0
|
1
|
742
|
POST
|
Here is a simple sample I modified from online sandbox, basically it's just coordinateCoversionWidget.conversions.add(new Conversion({ format:SUPPORTED FORMAT })); < html > < head > < meta charset = " utf-8 " /> < meta name = " viewport " content = " initial-scale = 1, maximum-scale = 1,user-scalable = no " /> < title > CoordinateConversion widget - 4.14 title > < link rel = " stylesheet " href = " https://js.arcgis.com/4.14/esri/themes/light/main.css " /> < style > html, body, #viewDiv { padding : 0 ; margin : 0 ; height : 100% ; width : 100% ; overflow : hidden ; } style > < script src = " https://js.arcgis.com/4.14/ " > script > < script > require ( [ "esri/views/MapView" , "esri/widgets/CoordinateConversion" , "esri/widgets/CoordinateConversion/support/Conversion" , "esri/Map" ] , function ( MapView , CoordinateConversion , Conversion , Map ) { var map = new Map ( { basemap : "topo" } ) ; var view = new MapView ( { container : "viewDiv" , map : map , center : [ - 117.049 , 34.485 ] , zoom : 12 } ) ; var ccWidget = new CoordinateConversion ( { view : view , multipleConversions : true } ) ; var formatsName = [ "dd" , "ddm" , "dms" , "mgrs" , "usng" , "utm" , "xy" ] ; for ( var i = 0 ; i < ccWidget . formats . items . length ; i ++ ) { var f = ccWidget . formats . items [ i ] ; if ( formatsName . indexOf ( f . name ) > - 1 ) { ccWidget . conversions . add ( new Conversion ( { format : f } ) ) ; } } view . ui . add ( ccWidget , "bottom-left" ) ; } ) ; script > head > < body class = " calcite " > < div id = " viewDiv " > div > body > html >
... View more
02-17-202007:47 PM
|
1
|
3
|
1343
|
POST
|
Hi Clinton, Which version are you using? The latest one is configurable:
... View more
02-17-202004:42 PM
|
0
|
5
|
1343
|
POST
|
Hi Piet, Try PortalGroup class, with method queryItems PortalGroup | API Reference | ArcGIS API for JavaScript 3.31 Here is reference for query parameters, type should be 'map'. Search reference—ArcGIS REST API: Users, groups, and content | ArcGIS for Developers
... View more
02-17-202004:27 PM
|
1
|
4
|
742
|
POST
|
Hi Matthieu, Are you using 4.x API? Here is the example: AttachmentsContent | ArcGIS API for JavaScript 4.14 // Create the AttachmentsContent popup element // If the selected feature has attributes associated with it, they will display within the popup let attachmentsElement = new AttachmentsContent ( { displayType : "list" } ) ; // Create the PopupTemplate let template = new PopupTemplate ( { title : "Beverly Hills trees by block" , outFields : [ "*" ] , content : [ attachmentsElement ] } ) ; If you are using 3.x API, it should like this: Popup with related fields | ArcGIS API for JavaScript 3.31 var popupTemplate = new PopupTemplate ( { "title" : "Beverly Hills Trees By Block" , "fieldInfos" : [ //... ] , "description" : "" , "showAttachments" : true , "mediaInfos" : [ ] } ) ; var featureLayer = new FeatureLayer ( [ LAYERURL ] , { mode : FeatureLayer . MODE_SNAPSHOT , infoTemplate : popupTemplate , outFields : [ "*" ] } ) ;
... View more
02-17-202004:06 PM
|
0
|
0
|
540
|
BLOG
|
easy peasy, this is very helpful.
... View more
02-04-202004:16 PM
|
0
|
0
|
494
|
Title | Kudos | Posted |
---|---|---|
1 | 02-19-202003:59 PM | |
1 | 08-07-201906:57 PM | |
1 | 02-18-202005:11 PM | |
1 | 02-18-202003:56 PM | |
1 | 02-03-202009:37 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-202002:23 AM
|