Skip to content

Commit 414cd52

Browse files
durrankangas
authored andcommitted
INT-1575: Store mapbox css locally and load with less styles
(cherry picked from commit c0e6a26)
1 parent 9f6c2c2 commit 414cd52

File tree

3 files changed

+245
-1
lines changed

3 files changed

+245
-1
lines changed

src/app/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
background-color: #4c5259; /* @slate1 */
1414
}
1515
</style>
16-
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.15.0/mapbox-gl.css' rel='stylesheet' />
1716
</head>
1817
<body>
1918
<div id="application">

src/app/index.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@
2222
@import "../auto-update/index.less";
2323
@import "../help/index.less";
2424
@import "metrics/index.less";
25+
@import "./styles/mapbox-gl.css";

src/app/styles/mapbox-gl.css

Lines changed: 244 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,244 @@
1+
.mapboxgl-map {
2+
font: 12px/20px 'Helvetica Neue', Arial, Helvetica, sans-serif;
3+
overflow: hidden;
4+
position: relative;
5+
-webkit-tap-highlight-color: rgba(0,0,0,0);
6+
}
7+
8+
.mapboxgl-canvas-container.mapboxgl-interactive,
9+
.mapboxgl-ctrl-nav-compass {
10+
cursor: -webkit-grab;
11+
cursor: -moz-grab;
12+
cursor: grab;
13+
}
14+
.mapboxgl-canvas-container.mapboxgl-interactive:active,
15+
.mapboxgl-ctrl-nav-compass:active {
16+
cursor: -webkit-grabbing;
17+
cursor: -moz-grabbing;
18+
cursor: grabbing;
19+
}
20+
21+
.mapboxgl-ctrl-top-left,
22+
.mapboxgl-ctrl-top-right,
23+
.mapboxgl-ctrl-bottom-left,
24+
.mapboxgl-ctrl-bottom-right { position:absolute; }
25+
.mapboxgl-ctrl-top-left { top:0; left:0; }
26+
.mapboxgl-ctrl-top-right { top:0; right:0; }
27+
.mapboxgl-ctrl-bottom-left { bottom:0; left:0; }
28+
.mapboxgl-ctrl-bottom-right { right:0; bottom:0; }
29+
30+
.mapboxgl-ctrl { clear:both; }
31+
.mapboxgl-ctrl-top-left .mapboxgl-ctrl { margin:10px 0 0 10px; float:left; }
32+
.mapboxgl-ctrl-top-right .mapboxgl-ctrl{ margin:10px 10px 0 0; float:right; }
33+
.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl { margin:0 0 10px 10px; float:left; }
34+
.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl { margin:0 10px 10px 0; float:right; }
35+
36+
.mapboxgl-ctrl-group {
37+
border-radius: 4px;
38+
-moz-box-shadow: 0px 0px 2px rgba(0,0,0,0.1);
39+
-webkit-box-shadow: 0px 0px 2px rgba(0,0,0,0.1);
40+
box-shadow: 0px 0px 0px 2px rgba(0,0,0,0.1);
41+
overflow: hidden;
42+
background: #fff;
43+
}
44+
.mapboxgl-ctrl-group > button {
45+
width: 30px;
46+
height: 30px;
47+
display: block;
48+
padding: 0;
49+
outline: none;
50+
border: none;
51+
border-bottom: 1px solid #ddd;
52+
box-sizing: border-box;
53+
background-color: rgba(0,0,0,0);
54+
cursor: pointer;
55+
}
56+
/* https://bugzilla.mozilla.org/show_bug.cgi?id=140562 */
57+
.mapboxgl-ctrl > button::-moz-focus-inner {
58+
border: 0;
59+
padding: 0;
60+
}
61+
.mapboxgl-ctrl > button:last-child {
62+
border-bottom: 0;
63+
}
64+
.mapboxgl-ctrl > button:hover {
65+
background-color: rgba(0,0,0,0.05);
66+
}
67+
.mapboxgl-ctrl-icon,
68+
.mapboxgl-ctrl-icon > div.arrow {
69+
speak: none;
70+
-webkit-font-smoothing: antialiased;
71+
-moz-osx-font-smoothing: grayscale;
72+
}
73+
.mapboxgl-ctrl-icon.mapboxgl-ctrl-zoom-out {
74+
padding: 5px;
75+
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20viewBox%3D%270%200%2020%2020%27%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%3E%0A%20%20%3Cpath%20style%3D%27fill%3A%23333333%3B%27%20d%3D%27m%207%2C9%20c%20-0.554%2C0%20-1%2C0.446%20-1%2C1%200%2C0.554%200.446%2C1%201%2C1%20l%206%2C0%20c%200.554%2C0%201%2C-0.446%201%2C-1%200%2C-0.554%20-0.446%2C-1%20-1%2C-1%20z%27%20%2F%3E%0A%3C%2Fsvg%3E%0A");
76+
}
77+
.mapboxgl-ctrl-icon.mapboxgl-ctrl-zoom-in {
78+
padding: 5px;
79+
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20viewBox%3D%270%200%2020%2020%27%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%3E%0A%20%20%3Cpath%20style%3D%27fill%3A%23333333%3B%27%20d%3D%27M%2010%206%20C%209.446%206%209%206.4459904%209%207%20L%209%209%20L%207%209%20C%206.446%209%206%209.446%206%2010%20C%206%2010.554%206.446%2011%207%2011%20L%209%2011%20L%209%2013%20C%209%2013.55401%209.446%2014%2010%2014%20C%2010.554%2014%2011%2013.55401%2011%2013%20L%2011%2011%20L%2013%2011%20C%2013.554%2011%2014%2010.554%2014%2010%20C%2014%209.446%2013.554%209%2013%209%20L%2011%209%20L%2011%207%20C%2011%206.4459904%2010.554%206%2010%206%20z%27%20%2F%3E%0A%3C%2Fsvg%3E%0A");
80+
}
81+
.mapboxgl-ctrl-icon.mapboxgl-ctrl-compass > div.arrow {
82+
width: 20px;
83+
height: 20px;
84+
margin: 5px;
85+
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%0A%09%3Cpolygon%20fill%3D%27%23333333%27%20points%3D%276%2C9%2010%2C1%2014%2C9%27%2F%3E%0A%09%3Cpolygon%20fill%3D%27%23CCCCCC%27%20points%3D%276%2C11%2010%2C19%2014%2C11%20%27%2F%3E%0A%3C%2Fsvg%3E");
86+
background-repeat: no-repeat;
87+
}
88+
89+
.mapboxgl-ctrl.mapboxgl-ctrl-attrib {
90+
padding: 0 5px;
91+
background-color: rgba(255,255,255,0.5);
92+
margin: 0;
93+
}
94+
.mapboxgl-ctrl-attrib a {
95+
color: rgba(0,0,0,0.75);
96+
text-decoration: none;
97+
}
98+
.mapboxgl-ctrl-attrib a:hover {
99+
color: inherit;
100+
text-decoration: underline;
101+
}
102+
.mapboxgl-ctrl-attrib .mapbox-improve-map {
103+
font-weight: bold;
104+
margin-left: 2px;
105+
}
106+
107+
.mapboxgl-popup {
108+
position: absolute;
109+
display: -webkit-flex;
110+
display: flex;
111+
will-change: transform;
112+
pointer-events: none;
113+
}
114+
.mapboxgl-popup-anchor-top,
115+
.mapboxgl-popup-anchor-top-left,
116+
.mapboxgl-popup-anchor-top-right {
117+
-webkit-flex-direction: column;
118+
flex-direction: column;
119+
}
120+
.mapboxgl-popup-anchor-bottom,
121+
.mapboxgl-popup-anchor-bottom-left,
122+
.mapboxgl-popup-anchor-bottom-right {
123+
-webkit-flex-direction: column-reverse;
124+
flex-direction: column-reverse;
125+
}
126+
.mapboxgl-popup-anchor-left {
127+
-webkit-flex-direction: row;
128+
flex-direction: row;
129+
}
130+
.mapboxgl-popup-anchor-right {
131+
-webkit-flex-direction: row-reverse;
132+
flex-direction: row-reverse;
133+
}
134+
.mapboxgl-popup-tip {
135+
width: 0;
136+
height: 0;
137+
border: 10px solid transparent;
138+
z-index: 1;
139+
}
140+
.mapboxgl-popup-anchor-top .mapboxgl-popup-tip {
141+
-webkit-align-self: center;
142+
align-self: center;
143+
border-top: none;
144+
border-bottom-color: #fff;
145+
}
146+
.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip {
147+
-webkit-align-self: flex-start;
148+
align-self: flex-start;
149+
border-top: none;
150+
border-left: none;
151+
border-bottom-color: #fff;
152+
}
153+
.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip {
154+
-webkit-align-self: flex-end;
155+
align-self: flex-end;
156+
border-top: none;
157+
border-right: none;
158+
border-bottom-color: #fff;
159+
}
160+
.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip {
161+
-webkit-align-self: center;
162+
align-self: center;
163+
border-bottom: none;
164+
border-top-color: #fff;
165+
}
166+
.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip {
167+
-webkit-align-self: flex-start;
168+
align-self: flex-start;
169+
border-bottom: none;
170+
border-left: none;
171+
border-top-color: #fff;
172+
}
173+
.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip {
174+
-webkit-align-self: flex-end;
175+
align-self: flex-end;
176+
border-bottom: none;
177+
border-right: none;
178+
border-top-color: #fff;
179+
}
180+
.mapboxgl-popup-anchor-left .mapboxgl-popup-tip {
181+
-webkit-align-self: center;
182+
align-self: center;
183+
border-left: none;
184+
border-right-color: #fff;
185+
}
186+
.mapboxgl-popup-anchor-right .mapboxgl-popup-tip {
187+
-webkit-align-self: center;
188+
align-self: center;
189+
border-right: none;
190+
border-left-color: #fff;
191+
}
192+
.mapboxgl-popup-close-button {
193+
position: absolute;
194+
right: 0;
195+
top: 0;
196+
border: none;
197+
border-radius: 0 3px 0 0;
198+
cursor: pointer;
199+
background-color: rgba(0,0,0,0);
200+
}
201+
.mapboxgl-popup-close-button:hover {
202+
background-color: rgba(0,0,0,0.05);
203+
}
204+
.mapboxgl-popup-content {
205+
position: relative;
206+
background: #fff;
207+
border-radius: 3px;
208+
box-shadow: 0 1px 2px rgba(0,0,0,0.10);
209+
padding: 10px 10px 15px;
210+
pointer-events: auto;
211+
}
212+
.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content {
213+
border-top-left-radius: 0;
214+
}
215+
.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content {
216+
border-top-right-radius: 0;
217+
}
218+
.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content {
219+
border-bottom-left-radius: 0;
220+
}
221+
.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content {
222+
border-bottom-right-radius: 0;
223+
}
224+
225+
.mapboxgl-crosshair,
226+
.mapboxgl-crosshair .mapboxgl-interactive,
227+
.mapboxgl-crosshair .mapboxgl-interactive:active {
228+
cursor: crosshair;
229+
}
230+
.mapboxgl-boxzoom {
231+
position: absolute;
232+
top: 0;
233+
left: 0;
234+
width: 0;
235+
height: 0;
236+
background: #fff;
237+
border: 2px dotted #202020;
238+
opacity: 0.5;
239+
}
240+
@media print {
241+
.mapbox-improve-map {
242+
display:none;
243+
}
244+
}

0 commit comments

Comments
 (0)