Skip to content

Commit

Permalink
整理less.css文件
Browse files Browse the repository at this point in the history
  • Loading branch information
fengluhome committed Jan 16, 2019
1 parent b403bd6 commit 346793d
Show file tree
Hide file tree
Showing 7 changed files with 165 additions and 154 deletions.
1 change: 1 addition & 0 deletions examples/PolygonOverlay.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
},
legend: {
show: true,
title: "图例",
formatter: function (val) {
return val + "%";
}
Expand Down
2 changes: 1 addition & 1 deletion src/map/Legend.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export default class Legend {
text = `${val.start==null?'-<span class="inmap-infinity"></span>': this._toFixed(val.start)} ~ ${ val.end==null ?'+<span class="inmap-infinity"></span>':this._toFixed(val.end)}`;
}
}
let td = isShow ? ` <td style="background:${backgroundColor}; width:17px;"></td>` : '';
let td = isShow ? ` <td style="background:${backgroundColor}; width:17px;height:17px;"></td>` : '';
str += `
<tr>
${td}
Expand Down
2 changes: 1 addition & 1 deletion src/map/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Toolbar from './Toolbar';
import MapConfig from '../config/MapConfig';
import Config from '../config/Config';
import MultiOverlay from '../overlay/base/MultiOverlay';
import './map.less';
import './style/index.less';

export default class Map {
constructor(ops) {
Expand Down
152 changes: 0 additions & 152 deletions src/map/map.less

This file was deleted.

12 changes: 12 additions & 0 deletions src/map/style/base.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@zoom-backgroud: #fff;
@zoom-color: #666;
@zoom-disabled-color: rgba(187, 190, 196, 0.6);
@zoom-disabled-backgroud: #f7f7f7;
@zoom-disabled-border-color: #dddee1;
@tooltip-background: rgba(50, 50, 50, 0.7);
@tooltip-border-color: rgb(51, 51, 51);
@tooltip-color: rgb(255, 255, 255);
@legend-background: rgba(255, 255, 255, 0.7);
@legend-shadow: rgba(8, 16, 34, 0.3);
@legend-color: #000000;
@legend-infinity-color: #495060;
2 changes: 2 additions & 0 deletions src/map/style/index.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@import './base.less';
@import './style.less';
148 changes: 148 additions & 0 deletions src/map/style/style.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
.inmap {
&-container,
{
opacity: 1;
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
}
&-container,
&-container *:after,
&-container *:before {
display: -webkit-box;
}
&-scale-group {
position: absolute;
right: 10px;
bottom: 35px;
z-index: 999999;
opacity: 1;
}
&-scale-group>a {
display: block;
width: 24px;
height: 24px;
font-size: 17px;
line-height: 22px;
text-align: center;
background: @zoom-backgroud;
margin-top: 5px;
color: @zoom-color;
cursor: pointer;
text-decoration: none;
}
&-scale-group>a[disabled] {
color: @zoom-disabled-color ;
background-color: @zoom-disabled-backgroud;
border-color: @zoom-disabled-border-color;
}
&-tooltip {
position: absolute;
opacity: 1;
display: none;
pointer-events: none;
border-style: solid;
white-space: nowrap;
z-index: 9999999;
transition: left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1);
border-radius: 4px;
font-style: normal;
font-variant: normal;
font-weight: normal;
font-stretch: normal;
font-size: 14px;
font-family: sans-serif;
line-height: 21px;
padding: 5px;
left: 323px;
top: 451px;
}
&-tooltip-black {
border-width: 0px;
border-color: @tooltip-border-color;
background-color: @tooltip-background;
color: @tooltip-color;
}
&-legend-container {
position: absolute;
left: 35px;
bottom: 35px;
z-index: 9999;
}
&-legend {
list-style: none;
opacity: 1;
height: auto;
font-size: 12px;
color: @legend-color;
text-align: center;
border: 10px solid @legend-background;
box-shadow: @legend-shadow 2px 0px 7px;
border-radius: 5px;
margin-right: 3px;
.inmap-legend-text {
background-color: @legend-background;
padding-left: 5px;
text-align: left;
font-size: 12px;
}
.inmap-legend-title {
background-color: @legend-background;
padding-bottom: 3px;
}
.inmap-legend-chunk {
display: inline-block;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 14px;
}
.inmap-infinity {
top: 4px;
left: 7px;
position: relative;
margin-right: 12px;
}
.inmap-infinity:before,
.inmap-infinity:after {
content: "";
box-sizing: border-box;
width: 6px;
height: 6px;
position: absolute;
top: 0;
left: 0;
border: 1px solid @legend-infinity-color;
-moz-border-radius: 50px 50px 0;
border-radius: 50px 50px 0 50px;
-webkit-transform: rotate(128deg);
-moz-transform: rotate(128deg);
-ms-transform: rotate(128deg);
-o-transform: rotate(128deg);
transform: rotate(128deg);
}
.inmap-infinity:after {
left: auto;
right: 0;
-moz-border-radius: 50px 50px 50px 0;
border-radius: 50px 50px 50px 0;
-webkit-transform: rotate(-128deg);
-moz-transform: rotate(-128deg);
-ms-transform: rotate(-128deg);
-o-transform: rotate(-128deg);
transform: rotate(-128deg);
}
}
&-legend>table {
width: 100%;
min-width: 72px;
}
&-legend table,
&-legend table tbody,
&-legend table tr,
&-legend table tr td {
padding: 0;
border: 0;
margin: 0;
}
}

0 comments on commit 346793d

Please sign in to comment.