Skip to content

Commit cf01a72

Browse files
committed
fix: buttons north and save
1 parent 7804ae1 commit cf01a72

File tree

2 files changed

+14
-17
lines changed

2 files changed

+14
-17
lines changed

src/GEOComp.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export const CompStyles = [
7878
draw:delete: false
7979
draw:redo: false,
8080
draw:undo: false,
81-
tracker:save:false,
81+
save:false,
8282
scale:false,
8383
fullscreen:false,
8484
layers:false,
@@ -87,7 +87,7 @@ export const CompStyles = [
8787
timeline: false,
8888
center:false,
8989
tracker :false,
90-
rotateNorth: false,
90+
north: false,
9191
}
9292
*/
9393
var GEOComp = (function () {

src/vendors/Geo.jsx

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ function Geo(props) {
157157
&& (showButton('draw:move') || showButton('draw:point') || showButton('draw:line')
158158
|| showButton('draw:polygon') || showButton('draw:undo') || showButton('draw:redo')
159159
|| showButton('draw:delete')))
160-
|| (featureEnabled('tracker') && showButton('tracker:save')
161-
|| showButton('center')))
160+
|| showButton('save')
161+
|| showButton('center'))
162162
olMap.addControl(mainbar);
163163

164164
//GeoLocation
@@ -316,18 +316,15 @@ function Geo(props) {
316316
if (showButton('draw:redo')) mainbar.addControl(redo);
317317
}
318318

319-
//Are we supporting tracker
320-
if (featureEnabled('tracker')) {
321-
// Add a simple push button to save features
322-
var save = new Button({
323-
html: '<i class="fa fa-download"></i>',
324-
title: "Save",
325-
handleClick: function (e) {
326-
fireEvent("tracker:save", new GeoJSON().writeFeaturesObjects(trackerVector.getSource().getFeatures()))
327-
}
328-
});
329-
if (showButton('tracker:save')) mainbar.addControl(save);
330-
}
319+
// Add a simple push button to save features
320+
var save = new Button({
321+
html: '<i class="fa fa-download"></i>',
322+
title: "Save",
323+
handleClick: function (e) {
324+
fireEvent("save")
325+
}
326+
});
327+
if (showButton("save")) mainbar.addControl(save);
331328

332329
//Fullscreen
333330
var fullscreen = new FullScreen()
@@ -498,7 +495,7 @@ function Geo(props) {
498495

499496
//rotateNorth control
500497
var rotateNorth = new RotateNorthControl();
501-
if (showButton('rotateNorth')) mainbar.addControl(rotateNorth);
498+
if (showButton('north')) mainbar.addControl(rotateNorth);
502499

503500
// CanvasScaleLine control
504501
var scaleLineControl = new CanvasScaleLine();

0 commit comments

Comments
 (0)