From 16d04bd6bbea63c18ad75b61d78f34a1506beba1 Mon Sep 17 00:00:00 2001 From: muerwre Date: Mon, 27 Aug 2018 17:43:31 +0700 Subject: [PATCH] changed user location marker --- src/components/UserLocation.jsx | 4 +--- src/containers/App.jsx | 15 --------------- src/styles/map.less | 30 +++++++++--------------------- 3 files changed, 10 insertions(+), 39 deletions(-) diff --git a/src/components/UserLocation.jsx b/src/components/UserLocation.jsx index e8f89fc..8c56198 100644 --- a/src/components/UserLocation.jsx +++ b/src/components/UserLocation.jsx @@ -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 (
- ) + ); } } diff --git a/src/containers/App.jsx b/src/containers/App.jsx index 3e74bb4..e99c3a9 100644 --- a/src/containers/App.jsx +++ b/src/containers/App.jsx @@ -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', diff --git a/src/styles/map.less b/src/styles/map.less index 5fa3f33..49af5bb 100644 --- a/src/styles/map.less +++ b/src/styles/map.less @@ -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; } }