Closed blewis closed 7 years ago
Apparently the client when saving layers is mixing them. The behavior is very unpredictable. For example in this map I added 4 remote layers, and they are now all displaying the same remote layer, while it should not: http://worldmap.harvard.edu/maps/11655
It can be hard to fix this one...
Here is an easy way to replicate it: create a new map and add two remote layers:
Layers are correctly added to the map:
But as soon as I save them, the two layers are pointing to the same layer (the first one which was added).
Until we don't fix this we should remove all of the remote layers from Solr, because any map with remote layers will be broken by this bug.
After a quick javascript debug, it looks like the correct config is sent to django from here:
so it must be something in django causing the problem. Looking into it.
No, the problem is in javascript. Here is what we get to Django, as you can see one of the source of the two layers is missing and both the two layers are using the same source
{ 'map': { 'layers': [{ 'opacity': 1, 'args': ['No background'], 'group': 'background', 'name': 'No background', 'title': 'No background', 'selected': False, 'visibility': False, 'source': '1', 'fixed': True, 'type': 'OpenLayers.Layer' }, { 'opacity': 1, 'args': ['OpenStreetMap'], 'group': 'background', 'name': 'OpenStreetMap', 'title': 'OpenStreetMap', 'selected': False, 'visibility': False, 'source': '1', 'fixed': True, 'type': 'OpenLayers.Layer.OSM' }, { 'opacity': 1, 'group': 'background', 'name': 'osm', 'title': 'MapQuest OpenStreetMap', 'selected': False, 'visibility': False, 'source': '2', 'fixed': True }, { 'opacity': 1, 'group': 'background', 'name': 'watercolor', 'title': 'Stamen Watercolor', 'selected': False, 'visibility': False, 'source': '4', 'fixed': True }, { 'opacity': 1, 'group': 'background', 'name': 'toner', 'title': 'Stamen Toner', 'selected': False, 'visibility': False, 'source': '4', 'fixed': True }, { 'opacity': 1, 'selected': False, 'group': 'background', 'name': 'World Street Map', 'format': 'jpeg', 'title': 'ESRI World Street Map', 'visibility': False, 'source': '5', 'tiled': False, 'fixed': True }, { 'opacity': 1, 'selected': False, 'group': 'background', 'name': 'World Imagery', 'format': 'jpeg', 'title': 'ESRI World Imagery', 'visibility': False, 'source': '6', 'tiled': False, 'fixed': True }, { 'opacity': 1, 'selected': False, 'group': 'background', 'name': 'Light Gray Canvas Base', 'format': 'jpeg', 'title': 'ESRI Light Gray Reference', 'visibility': False, 'source': '7', 'tiled': False, 'fixed': True }, { 'opacity': 1, 'group': 'background', 'name': 'SATELLITE', 'title': 'Google Satellite', 'selected': False, 'visibility': False, 'source': '8', 'fixed': True }, { 'opacity': 1, 'group': 'background', 'name': 'TERRAIN', 'title': 'Google Terrain', 'selected': False, 'visibility': True, 'source': '8', 'fixed': True }, { 'opacity': 1, 'group': 'background', 'name': 'HYBRID', 'title': 'Google Hybrid', 'selected': False, 'visibility': False, 'source': '8', 'fixed': True }, { 'opacity': 1, 'group': 'background', 'name': 'ROADMAP', 'title': 'Google Roadmap', 'selected': False, 'visibility': False, 'source': '8', 'fixed': True }, { 'opacity': 1, 'group': 'General', 'name': '1', 'title': 'IndexLetIdent', 'selected': False, 'visibility': True, 'source': '0', 'detail_url': 'http://hh.worldmap.harvard.edu/registry/hypermap/layer/1a7a9f8c-20d6-476c-a12c-b44aa6ae1337/', 'local': False }, { 'opacity': 1, 'group': 'General', 'name': '0', 'title': 'Major World Watersheds', 'selected': True, 'visibility': True, 'source': '0', 'detail_url': 'http://hh.worldmap.harvard.edu/registry/hypermap/layer/ee572a44-b493-44ec-9db1-88bd0ece7a70/', 'local': False }], 'projection': 'EPSG:900913', 'center': [0, 0], 'zoom': 3, 'groups': [{ 'expanded': 'true', 'group': 'General' }], 'units': 'm', 'maxResolution': 156543.03390625, 'numZoomLevels': 22, 'maxExtent': [-20037508.34, -20037508.34, 20037508.34, 20037508.34] }, 'about': { 'urlsuffix': u '', 'abstract': u '', 'introtext': '<h3>The Harvard WorldMap Project</h3> <p>WorldMap is an open source web mapping system that is currently under construction. It is built to assist academic research and teaching as well as the general public and supports discovery, investigation, analysis, visualization, communication and archiving of multi-disciplinary, multi-source and multi-format data, organized spatially and temporally.</p> <p>The first instance of WorldMap, focused on the continent of Africa, is called AfricaMap. Since its beta release in November of 2008, the framework has been implemented in several geographic locations with different research foci, including metro Boston, East Asia, Vermont, Harvard Forest and the city of Paris. These web mapping applications are used in courses as well as by individual researchers.</p> <h3>Introduction to the WorldMap Project</h3> <p>WorldMap solves the problem of discovering where things happen. It draws together an array of public maps and scholarly data to create a common source where users can:</p> <ol> <li>Interact with the best available public data for a city/region/continent</li> <li>See the whole of that area yet also zoom in to particular places</li> <li>Accumulate both contemporary and historical data supplied by researchers and make it permanently accessible online</li> <li>Work collaboratively across disciplines and organizations with spatial information in an online environment</li> </ol> <p>The WorldMap project aims to accomplish these goals in stages, with public and private support. It draws on the basic insight of geographic information systems that spatiotemporal data becomes more meaningful as more "layers" are added, and makes use of tiling and indexing approaches to facilitate rapid search and visualization of large volumes of disparate data.</p> <p>WorldMap aims to augment existing initiatives for globally sharing spatial data and technology such as <a target="_blank" href="http://www.gsdi.org/">GSDI</a> (Global Spatial Data Infrastructure).WorldMap makes use of <a target="_blank" href="http://www.opengeospatial.org/">OGC</a> (Open Geospatial Consortium) compliant web services such as <a target="_blank" href="http://en.wikipedia.org/wiki/Web_Map_Service">WMS</a> (Web Map Service), emerging open standards such as <a target="_blank" href="http://wiki.osgeo.org/wiki/Tile_Map_Service_Specification">WMS-C</a> (cached WMS), and standards-based metadata formats, to enable WorldMap data layers to be inserted into existing data infrastructures. <br> <br> All WorldMap source code will be made available as <a target="_blank" href="http://www.opensource.org/">Open Source</a> for others to use and improve upon.</p>', 'officialurl': u '', 'title': 'test11' }, 'localGeoServerBaseUrl': 'http://192.168.33.16:8080/geoserver/', 'localCSWBaseUrl': 'http://192.168.33.16:8080/geonetwork/srv/en/csw', 'edit_map': True, 'db_datastore': True, 'authorizedRoles': 'ROLE_ADMINISTRATOR', 'rest': '/maps/', 'defaultSourceType': 'gxp_gnsource', 'sources': { '1': { 'id': '1', 'ptype': 'gx_olsource', 'projection': 'EPSG:900913' }, '0': { 'projection': 'EPSG:900913', 'title': 'GeoNode Source', 'url': 'http://hh.worldmap.harvard.edu/registry/hypermap/layer/ee572a44-b493-44ec-9db1-88bd0ece7a70/map/wmts/0/default_grid/${z}/${x}/${y}.png', 'ptype': 'gxp_gnsource', 'restUrl': '/gs/rest', 'id': '0' }, '3': { 'id': '3', 'ptype': 'gxp_mapboxsource', 'projection': 'EPSG:900913' }, '2': { 'id': '2', 'ptype': 'gxp_mapquestsource', 'projection': 'EPSG:900913' }, '5': { 'url': 'http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer', 'id': '5', 'ptype': 'gxp_arcgiscachesource', 'projection': 'EPSG:900913' }, '4': { 'id': '4', 'ptype': 'gxp_stamensource', 'projection': 'EPSG:900913' }, '7': { 'url': 'http://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer', 'id': '7', 'ptype': 'gxp_arcgiscachesource', 'projection': 'EPSG:900913' }, '6': { 'url': 'http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer', 'id': '6', 'ptype': 'gxp_arcgiscachesource', 'projection': 'EPSG:900913' }, '8': { 'id': '8', 'ptype': 'gx_googlesource', 'projection': 'EPSG:900913' }, 'csw': { 'url': 'http://192.168.33.16:8080/geonetwork/srv/en/csw', 'id': 'csw', 'ptype': 'gxp_cataloguesource', 'proxyOptions': { 'listeners': {} }, 'projection': 'EPSG:900913' }, 'local': { 'url': '/geoserver:8080/wms', 'restUrl': '/gs:8080/rest', 'id': 'local', 'ptype': 'gxp_gnsource', 'projection': 'EPSG:900913' } }, 'proxy': '/proxy/?url=', 'social_explorer': [], 'homeUrl': '/', 'csrfToken': 'IsrVMiJtvXNrcGHNCpbNrYANxBz8YsSt', 'topic_categories': [ ['farming', 'Farming & Agriculture'], ['biota', 'Ecology & Biota'], ['boundaries', 'Boundaries'], ['climatologyMeteorologyAtmosphere', 'Climate & Weather'], ['economy', 'Economic Activities & Employment'], ['elevation', 'Elevation'], ['health', 'Health & Human Ecology'], ['environment', 'Environmental Resources, Conservation'], ['geoscientificInformation', 'Earth Sciences'], ['imageryBaseMapsEarthCover', 'Imagery & Base Maps'], ['location', 'Place Locations'], ['inlandWaters', 'Rivers, Streams, Lakes'], ['oceans', 'Oceans'], ['planningCadastre', 'Planning and Cadastral Data'], ['society', 'Society & Demographics'], ['structure', 'Structures'], ['transportation', 'Transportation'], ['utilitiesCommunication', 'Utilities & Infrastructure'], ['intelligenceMilitary', 'Military Bases & Activities'] ], 'tools': [], 'id': None }
After some investigation, the problem seems to arise only when two or more layers are added to the map before saving. Saving the map after adding each time a remote layer will create a correct configuration, with one different store for each remote layer. Without saving, all the remote layers will point to the same store, that is the one of the last added remote layer. WM layers will continue to work even when adding more remote layers at a time. So it is not so disruptive as I thought, but we need to fix it.
http://worldmap.harvard.edu/maps/bentest7