mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 02:56:41 +07:00
changed user location marker
This commit is contained in:
parent
d39ec1588c
commit
16d04bd6bb
3 changed files with 10 additions and 39 deletions
|
@ -16,7 +16,6 @@ export class UserLocation extends React.Component {
|
|||
this.mark = null;
|
||||
this.map = props.editor.map.map;
|
||||
this.location = [];
|
||||
// this.mark.addTo(props.editor.map.map);
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
|
@ -39,7 +38,6 @@ export class UserLocation extends React.Component {
|
|||
if (this.location && this.location.length === 2) {
|
||||
this.panMapTo(this.location[0], this.location[1]);
|
||||
} else {
|
||||
console.log('hoho');
|
||||
this.getUserLocation(this.panMapTo);
|
||||
}
|
||||
|
||||
|
@ -64,6 +62,6 @@ export class UserLocation extends React.Component {
|
|||
render() {
|
||||
return (
|
||||
<div className="locate-geo-button" onClick={this.centerMapOnLocation} />
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ import { Editor } from '$modules/Editor';
|
|||
import { EditorPanel } from '$components/panels/EditorPanel';
|
||||
import { Fills } from '$components/Fills';
|
||||
import { DEFAULT_LOGO } from '$constants/logos';
|
||||
import { getUserLocation } from '$utils/geolocation';
|
||||
import { UserLocation } from '$components/UserLocation';
|
||||
|
||||
export class App extends React.Component {
|
||||
|
@ -38,20 +37,6 @@ export class App extends React.Component {
|
|||
setLogo = logo => {
|
||||
this.setState({ logo });
|
||||
};
|
||||
//
|
||||
// locateByGeo = () => {
|
||||
// getUserLocation(this.setMapCenterByGeo);
|
||||
// };
|
||||
//
|
||||
// setMapCenterByGeo = position => {
|
||||
// if (!position || !position.coords || !position.coords.latitude || !position.coords.longitude) return;
|
||||
//
|
||||
// const { latitude, longitude } = position.coords;
|
||||
//
|
||||
// console.log('panning to', { latitude, longitude });
|
||||
//
|
||||
// this.editor.map.map.panTo([latitude, longitude]);
|
||||
// };
|
||||
|
||||
editor = new Editor({
|
||||
container: 'map',
|
||||
|
|
|
@ -73,36 +73,24 @@
|
|||
}
|
||||
|
||||
.location-marker {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
width: 0;
|
||||
height: 0;
|
||||
margin-left: -20px;
|
||||
margin-top: -20px;
|
||||
outline: none;
|
||||
z-index: 10001;
|
||||
|
||||
&:after {
|
||||
content: ' ';
|
||||
display: block;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 0 0 2px @location_line;
|
||||
position: absolute;
|
||||
left: 12px;
|
||||
top: 12px;
|
||||
}
|
||||
|
||||
&:before {
|
||||
content: ' ';
|
||||
display: block;
|
||||
width: 3px;
|
||||
height: 3px;
|
||||
border-radius: 5px;
|
||||
box-shadow: 0 0 0 2px @location_line;
|
||||
background: @location_line;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 0 0 4px @blue_secondary;
|
||||
position: absolute;
|
||||
left: 19px;
|
||||
top: 19px;
|
||||
left: 16px;
|
||||
top: 16px;
|
||||
background: @blue_primary;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue