refactor(a): add l7-draw source

This commit is contained in:
thinkinggis 2020-03-19 20:24:18 +08:00
parent c99a023a95
commit 54ba3889b0
5 changed files with 7 additions and 15 deletions

View File

@ -30,4 +30,4 @@ export default function glsl(include, minify) {
}; };
} }
}; };
} }

View File

@ -27,7 +27,7 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/7.8.3/polyfill.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/7.8.3/polyfill.min.js"></script>
<script src="https://api.mapbox.com/mapbox-gl-js/v1.8.0/mapbox-gl.js"></script> <script src="https://api.mapbox.com/mapbox-gl-js/v1.8.0/mapbox-gl.js"></script>
<script src="../dist/l7.js"></script> <script src="../dist/l7-dev.js"></script>
<script> <script>
console.log(L7); console.log(L7);
const scene = new L7.Scene({ const scene = new L7.Scene({

View File

@ -38,18 +38,6 @@ export default React.memo(function Map() {
bottom: 0, bottom: 0,
}} }}
> >
<SceneContext.Consumer>
{(scene) => {
console.log(scene);
return null;
}}
</SceneContext.Consumer>
<SceneEvent
type="click"
handler={() => {
console.log('click');
}}
/>
<Popup lnglat={[110.1938, 50.25] as number[]}> <Popup lnglat={[110.1938, 50.25] as number[]}>
<p>122222</p> <p>122222</p>
</Popup> </Popup>

View File

@ -30,6 +30,9 @@ export default React.memo(function Map() {
bottom: 0, bottom: 0,
}} }}
> >
<Popup lnglat={[110.1938, 50.25] as number[]}>
<p>122222</p>
</Popup>
{data && [ {data && [
<PolygonLayer <PolygonLayer
key={'2'} key={'2'}
@ -54,6 +57,7 @@ export default React.memo(function Map() {
opacity: 1, opacity: 1,
}} }}
/>, />,
<LineLayer <LineLayer
key={'21'} key={'21'}
source={{ source={{

View File

@ -107,7 +107,7 @@ export default React.memo(function Map() {
zoom: 1, zoom: 1,
}} }}
style={{ style={{
position: 'absolute', // position: 'absolute',
top: 0, top: 0,
left: 0, left: 0,
right: 0, right: 0,