|
POST
|
Turns out the syntax of the ESRI example works when adding an item (as layer) to web map using add_layer() works when it was created as empty new web map like this: webmap = Webmap() But not when the web map was created off another item and already has some layers... webmap = Webmap(item) This may be explained somewhere in ESRI documentation. Good to know!
... View more
07-23-2020
09:04 AM
|
1
|
0
|
4560
|
|
POST
|
Is anyone using Geojobe for administration of Portal for ArcGIS? Saw them posting in a geonet thread about deployment of items from one portal to another and subsequently sat through an impressive demo. Specifically, I would be interested in feedback around installation and maintenance of the product. I think feature and functionality speak for themselves. - Thanks.
... View more
07-22-2020
01:18 PM
|
0
|
3
|
2402
|
|
POST
|
Cross-posting for different audience from here. How do I fix a strange looking and unresponsive scrollbar in Search widget, i.e. a scrollbar that disappears when clicked on. I thought I was missing some parameter. But when I switched from Chrome to IE, I realize it's all browser related. The following works in IE but not in Chrome: // This is part of custom widget for Web Appbuilder, thus 3.x
this.mySearch = new Search({
sources: [ <list of sources> ] ,
map: this.map,
popupEnabled: false,
autoSelect: false,
enableSourcesMenu: false,
enableSuggestions: true,
maxSuggestions: 5,
allPlaceholder: "Example: John Wayne",
autoNavigate: false
}, "mySearch");
this.mySearch.startup(); I have found that I can tweak the scrollbar look (width/color) by overriding parameters in : ::-webkit-scrollbar {
...
} But what is the work-around for the click-on-scrollbar behavior? Thanks.
... View more
07-20-2020
05:16 PM
|
0
|
0
|
827
|
|
POST
|
This is Pro 2.5... I might try upgrading or at checking which version of arcgis modules my conda environment is using.
... View more
07-20-2020
03:26 PM
|
0
|
0
|
4560
|
|
POST
|
NewLayer is a Portal item that references a Map Service on our federated GIS Server. Where this all started was when I looked into copying a web map item from one Portal environment (Test) to another (Prod) and then trying to replace some map services .
... View more
07-20-2020
01:59 PM
|
0
|
2
|
4560
|
|
POST
|
As a habitual Chromehead, I just tried this in IE 11, and the scrollbar disappeared. Interesting... is this some kind of browser compatibility thing? And if so, any workarounds?
... View more
07-20-2020
01:28 PM
|
0
|
0
|
2241
|
|
POST
|
Derek, finally getting back to this... your suggestion worked great. Thanks again.
... View more
07-20-2020
12:07 PM
|
1
|
0
|
5413
|
|
POST
|
I guess could have provided a little more detail... the part of my custom widget I'm looking at uses an instance of Search (JSAPI 3.x). Code looks like this: this.mySearch = new Search({
sources: [ <list of sources> ] ,
map: this.map,
popupEnabled: false,
autoSelect: false,
enableSourcesMenu: false,
enableSuggestions: true,
maxSuggestions: 5,
allPlaceholder: "Example: John Wayne",
autoNavigate: false
}, "mySearch");
this.mySearch.startup();
This puts a sweet little search window with suggestions in my widget. Everything is working great, except the scrollbar. Where do I tweak this? My style.css is blank.
... View more
07-20-2020
11:41 AM
|
0
|
1
|
2241
|
|
POST
|
So it looks like the following works: newLayer_item = gis.content.search(query = "new layer"))[0]
###############################################
# the following line is new and made this work
newLayer = arcgis.gis.Layer(newLayer_item)
###############################################
web_map_obj.add_layer(newLayer)
# Now I can see the new layers with
web_map_obj.layers Anyone know if the above referenced original ESRI example will ever work and if I was doing something wrong?
... View more
07-20-2020
09:09 AM
|
0
|
0
|
4560
|
|
POST
|
Trying to add a layer (Portal item) to a webmap. The ESRI example for this I'm looking at is very simple: streets_item = gis.content.search("LA Streets","Map Service")[0]
wm = WebMap() # create an empty web map with a default basemap
wm.add_layer(streets_item) Okay, so I have a web map that's not empty that I created like this: print(type(target_item))
from arcgis.mapping import WebMap
web_map_obj = WebMap(target_item)
print(type(web_map_obj))
#>>> <class 'arcgis.gis.Item'>
#>>> <class 'arcgis.mapping._types.WebMap'>
The print() statements are only there to assure myself that I'm actually looking at items on and not itemId's or who knows what. So I have a legit Python web map based on on a web map item in Portal. As a check, I do... web_map_obj.layers
# prints out all the layers (map image layers) that nelong to the Portal web map So now, I want to add another layer newLayer = gis.content.search(query = "new layer"))[0]
# again just checking this is what I expect
print(type(newLayer))
web_map_obj.add_layer(newLayer) Well, this bombs... <class 'arcgis.gis.Item'>
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-191-62f982ec1c55> in <module>
13 # again just checking this is what I expect
14 print(type(newLayer))
---> 15 web_map_obj.add_layer(newLayer)
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\mapping\_types.py in add_layer(self, layer, options)
323
324 for lyr in layer.layers: # recurse - works for all.
--> 325 self.add_layer(lyr, options)
326 return True # end add_layer execution after iterating through each layer.
327 else:
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\mapping\_types.py in add_layer(self, layer, options)
510 fields_list = layer.properties.layerDefinition.fields
511
--> 512 for f in fields_list:
513 if isinstance(f, dict) or isinstance(f, PropertyMap):
514 field_dict = {'fieldName': f['name'],
TypeError: 'NoneType' object is not iterable
What's wrong with what I'm doing? I realize there is also arcgis.gis. Layer. Do I first need to create a Layer from the item and then add that to the web map maybe?
... View more
07-16-2020
02:15 PM
|
0
|
8
|
4665
|
|
POST
|
Following the general 3-step process I've seen in so many ESRI examples - Draft-Stage-Upload, the overwriting puzzled me until I added the line high lighted below: # Create MapImageSharingDraft and set service properties
sharing_draft = m.getWebLayerSharingDraft("FEDERATED_SERVER", "MAP_IMAGE", service)
...
##############################################################################
#The following line governs whether the new draft is used to overwrite the existing services
sharing_draft.overwriteExistingService = True
##############################################################################
...
sharing_draft.exportToSDDraft(sddraft_output_filename)
# Stage Service
..
arcpy.StageService_server(sddraft_output_filename, sd_output_filename)
# Share to portal
arcpy.UploadServiceDefinition_server(inSdFile, inServer, inServiceName,inCluster, inFolderType, inFolder, inStartup, inOverride, inMyContents, inPublic, The exact details may be different in your environment.That's why I've stripped it down.
... View more
07-16-2020
01:35 PM
|
1
|
0
|
1443
|
|
POST
|
Full disclosure: I've developed a few custom widgets now and am having fun with it but I have not touched any CSS in the process. So I've looked here: CSS framework—ArcGIS Web AppBuilder (Developer Edition) | ArcGIS for Developers and here: Make widgets user-friendly—ArcGIS Web AppBuilder (Developer Edition) | ArcGIS for Developers and here: Web AppBuilder Custom Widget | geodev-hackerlabs but no answer yet. -- Anyone have some better WAB related tutorial up their sleeve? I have a wonderful WAB custom widget that has only one issue. The scrollbar in a search box is super narrow and unusable. I've plowed through the mostly indecipherable CSS in apps\<999>\jimu.js\css searching for references to scrollbar. All I found was in jimu.css ... ::-webkit-scrollbar {
border-radius: 3px;
/* width was 6px changed to 10px */
width: 6px;
background-color: #EEEEEE;
height: 6px;
} when I made the above change, that has the desired effect. But is that the way to do it? How do I reference this same element in my custom widget style.css? Copying the above in there didn't work. And why is it that as soon as I click on the scrollbar, it disappears. You can scroll through the records using either and or the mouse wheel but not by clicking/holding down scrollbar.Is this search widget behavior and controlled through parameters there, or some event handler, or CSS? Thanks.
... View more
07-16-2020
01:03 PM
|
0
|
2
|
2295
|
|
POST
|
Did anyone ever get this resolved? Following some of the examples here and get this.... from arcgis.mapping import WebMap
web_map_obj = WebMap(item)
web_map_obj
>>> MapView(hide_mode_switch=True, layout=Layout(height='400px', width='100%'))
... View more
07-15-2020
02:21 PM
|
0
|
0
|
6426
|
|
POST
|
Great. Look forward to fixing this down the road with ExperienceBuilder!
... View more
07-15-2020
09:25 AM
|
0
|
0
|
2705
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-16-2025 07:32 AM | |
| 1 | 02-09-2024 05:18 PM | |
| 1 | 02-04-2025 09:27 AM | |
| 1 | 03-22-2019 10:55 AM | |
| 1 | 03-05-2020 08:46 AM |
| Online Status |
Offline
|
| Date Last Visited |
04-15-2026
12:14 PM
|