forked from geosolutions-it/geonode-mapstore-client
-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#351: Keep the resource WMS url params when creating the map with Map…
…Store (#461)
- Loading branch information
1 parent
de00615
commit e940f7d
Showing
2 changed files
with
38 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
geonode_mapstore_client/client/js/utils/__tests__/ResourceUtils-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
/* | ||
* Copyright 2021, GeoSolutions Sas. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import expect from 'expect'; | ||
import { resourceToLayerConfig } from '../ResourceUtils'; | ||
|
||
describe('Test Resource Utils', () => { | ||
it('should keep the wms params from the url if available', () => { | ||
const newLayer = resourceToLayerConfig({ | ||
alternate: 'geonode:layer_name', | ||
links: [{ | ||
extension: 'html', | ||
link_type: 'OGC:WMS', | ||
name: 'OGC WMS Service', | ||
mime: 'text/html', | ||
url: 'http://localhost:8080/geoserver/wms?map=name&map_resolution=91' | ||
}], | ||
title: 'Layer title', | ||
perms: [], | ||
pk: 1 | ||
}); | ||
expect(newLayer.params).toEqual({ map: 'name', map_resolution: '91' } ); | ||
}); | ||
}); |