Skip to content

Commit

Permalink
add config option to hide zoom buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
kochis committed Jul 25, 2024
1 parent 1ab01e2 commit f991ab6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ export interface RadarSearchGeofencesResponse extends RadarResponse {

export interface RadarMapOptions extends Omit<maplibregl.MapOptions, 'transformRequest'> {
language?: string;
showZoom?: boolean;
}

export interface RadarMarkerPopupOptions extends maplibregl.PopupOptions {
Expand Down
5 changes: 4 additions & 1 deletion src/ui/RadarMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ class RadarMap extends maplibregl.Map {
this.addControl(attribution, 'bottom-right');

// add zoom controls
const nav = new maplibregl.NavigationControl({ showCompass: false });
const nav = new maplibregl.NavigationControl({
showCompass: false,
showZoom: maplibreOptions.showZoom ?? true,
});
this.addControl(nav, 'bottom-right');

// handle map resize actions
Expand Down

0 comments on commit f991ab6

Please sign in to comment.