Select to view content in your preferred language

Change a feature layer Url

1669
2
Jump to solution
03-22-2018 01:09 PM
MarkCederholm
Frequent Contributor

Is it possible to change the Url of a FeatureLayer?  For example, changing

"https://oldserver/arcgis/rest/services/myfolder/mymapservice/MapServer/1"

to

"https://newserver/arcgis/rest/services/myfolder/mymapservice/MapServer/1"

When I try this:

fLyr.manager.update_definition({ "url":sNewLayerUrl })

I get "RuntimeError: Invalid URL (Error Code: 400)". 

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
MarcLEMAIRE
Occasional Contributor

hello Mark,

don't go so far, you don't need to go until the FeatureLayer object

Stay at the "Item" level, you just have to change the Item properties

item.update(item_properties={'url':newUrlString})

View solution in original post

2 Replies
MarcLEMAIRE
Occasional Contributor

hello Mark,

don't go so far, you don't need to go until the FeatureLayer object

Stay at the "Item" level, you just have to change the Item properties

item.update(item_properties={'url':newUrlString})

MarkCederholm
Frequent Contributor

It works, thanks.

0 Kudos