-
Notifications
You must be signed in to change notification settings - Fork 405
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fix #1176 implemented GraticuleLayer for leaflet * fix typo, year and returned null
- Loading branch information
1 parent
e3ce9ba
commit f1bea6b
Showing
5 changed files
with
50 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
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 2016, 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, | ||
showOriginLabel: true, | ||
redraw: 'move' | ||
}, options); | ||
if (SimpleGraticule) { | ||
return new SimpleGraticule(graticuleOptions); | ||
} | ||
return null; | ||
}, | ||
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