forked from geosolutions-it/MapStore2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix geosolutions-it#1176 implemented GraticuleLayer for leaflet
- Loading branch information
1 parent
d757ced
commit 79fc884
Showing
4 changed files
with
49 additions
and
0 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
web/client/components/map/leaflet/plugins/GraticuleLayer.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 2015, 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. | ||
*/ | ||
|
||
const Layers = require('../../../../utils/leaflet/Layers'); | ||
const SimpleGraticule = require('leaflet-simple-graticule/L.SimpleGraticule'); | ||
const assign = require('object-assign'); | ||
|
||
require('leaflet-simple-graticule/L.SimpleGraticule.css'); | ||
|
||
Layers.registerType('graticule', { | ||
create: (options) => { | ||
const graticuleOptions = assign({ | ||
interval: 20, | ||
showshowOriginLabel: true, | ||
redraw: 'move' | ||
}, options); | ||
if (SimpleGraticule) { | ||
return new SimpleGraticule(graticuleOptions); | ||
} | ||
return false; | ||
}, | ||
isValid: () => { | ||
return SimpleGraticule ? true : false; | ||
} | ||
}); |
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
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