Closed Clubdebambos closed 1 month ago
@Clubdebambos Some of these changes are being applied in the new mapping module implementation.
The reason this is occurring is because some properties (such as initial state) depend on a rendered map in the current implementation. The initial state is created on the Javascript side and not through the python side. We are working on changing this and relying more on python to initialize as much as we can.
Thanks for pointing out the time slider issue. I will test this on the new implementation and make sure the expected behavior is present
@Clubdebambos I've looked into this more and the time slider widget can only be created if the map is rendered either inside a jupyter notebook (in future a lab) or the GUI (i.e. map viewer). This is because it is created with Javascript code and JS needs a browser to run. Any sort of widget will have this limitation since it is Javascript backend that we are calling.
We are working on a python implementation of the webmap but not of the individual widgets at this point so we don't plan on having this work without the map being rendered.
Initial state is part of the webmap definition so this will be handled in the new python implementation of the module.
@Clubdebambos Please use the latest install of arcgis and the new arcgis-mapping packages to try again:
conda install -c esri arcgis arcgis-mapping
Documentation should be updated shortly with the new guides on how to use this module
Describe the bug Workflow relates to new Map Viewer (not the classic)
I have created a WebMap using the ArcGIS API for Python WebMap class and saving as a new WebMap with the save() method.
I have performed several other tasks using the API such as adding layers and tables, updating symbology, opacity, visibility etc. With each task I check the WebMap definition via the definition property for a WebMap object and also with the get_data() approach, neither of which return an initialState property. The initialState property is required to alter the extent of the WebMap upon opening. The only way to get the initialState property is to manually open the WebMap and perform a save, which defeats the purpose of the automation.
To Reproduce Steps to reproduce the behavior:
You can use the API to add layer and tables and update the WebMap object. Then access the WebMap deefinition
error:
Check out below, no initialState.
BUT when I open and save the WebMap manually and reprint...
I also notice that the timeSlider widget is not present in the first JSON printout even though a layer added using the API has time enabled. When I open the WebMap the time slider is there, but it takes a manual save for it to appear in the definition.
Screenshots If applicable, add screenshots to help explain your problem.
Expected behavior A clear and concise description of what you expected to happen.
Platform (please complete the following information):
Additional context initialState controls the default view, cannot update extent without its presence in the definition.