-
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.
Add typescript and refactor some of map
- Loading branch information
Toby Twigger
committed
Jun 30, 2023
1 parent
7cb439f
commit 2dd6c4e
Showing
17 changed files
with
1,105 additions
and
744 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,36 @@ | ||
<template> | ||
<div> | ||
<div style="height: 800px" ref="map"></div> | ||
<!-- <div id="routing-control">--> | ||
<!-- <c-routing-control :errors="errors" :schema.sync="_schema" :result="result"></c-routing-control>--> | ||
<!-- </div>--> | ||
<!-- <div id="elevation-control">--> | ||
<!-- <c-elevation-control :coordinates="result.coordinates" :selected="selectedIndex" @update:selected="selectedIndex = $event"></c-elevation-control>--> | ||
<!-- </div>--> | ||
<!-- <div id="place-control">--> | ||
<!-- <c-place-control :bounds="bounds" :places.sync="places" :zoom="zoom"></c-place-control>--> | ||
<!-- </div>--> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import CRoutingControl from 'ui/components/Route/controls/routing/CRoutingControl'; | ||
import CElevationControl from 'ui/components/Route/controls/elevation/CElevationControl'; | ||
import CPlaceControl from 'ui/components/Route/controls/places/CPlaceControl'; | ||
import maplibregl from 'maplibre-gl'; | ||
import Map from 'ui/tools/maps/map'; | ||
export default { | ||
name: "MapCanvas", | ||
components: {CPlaceControl, CElevationControl, CRoutingControl}, | ||
computed: { | ||
ref() { | ||
return this.$ref.map; | ||
} | ||
}, | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
</style> |
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,18 @@ | ||
import {Control} from "../types/MapType"; | ||
import BaseElevationControl from './../../../components/Route/controls/elevation/ElevationControl.js'; | ||
import {IControl} from "maplibre-gl"; | ||
|
||
class ElevationControl implements Control { | ||
config: object = {}; | ||
|
||
setConfig(config: object = {}): this { | ||
this.config = config; | ||
return this; | ||
}; | ||
|
||
createControl(): IControl { | ||
return new BaseElevationControl({}); | ||
} | ||
} | ||
|
||
export default ElevationControl; |
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,18 @@ | ||
import {Control} from "../types/MapType"; | ||
import maplibregl, {IControl} from "maplibre-gl"; | ||
|
||
class FullscreenControl implements Control { | ||
config: object = {}; | ||
|
||
setConfig(config: object = {}): this { | ||
this.config = config; | ||
|
||
return this; | ||
}; | ||
|
||
createControl(): IControl { | ||
return new maplibregl.FullscreenControl({}); | ||
} | ||
} | ||
|
||
export default FullscreenControl; |
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,31 @@ | ||
import {Control} from "../types/MapType"; | ||
import maplibregl, {IControl} from "maplibre-gl"; | ||
|
||
class GeolocateControl implements Control { | ||
config: object = {}; | ||
|
||
setConfig(config: object = {}): this { | ||
this.config = config; | ||
|
||
return this; | ||
}; | ||
|
||
createControl(): IControl { | ||
return new maplibregl.GeolocateControl({ | ||
positionOptions: { | ||
enableHighAccuracy: false, | ||
maximumAge: 0, | ||
timeout: 6000 /* 6 sec */ | ||
}, | ||
fitBoundsOptions: { | ||
maxZoom: 15 | ||
}, | ||
trackUserLocation: false, | ||
showAccuracyCircle: true, | ||
showUserLocation: true | ||
}); | ||
}; | ||
|
||
} | ||
|
||
export default GeolocateControl; |
Oops, something went wrong.