Merge pull request #253 from antvis/ios_12_event

Ios 12 event
This commit is contained in:
@thinkinggis 2020-03-15 13:25:21 +08:00 committed by GitHub
commit 64dab9c6c8
14 changed files with 56 additions and 38 deletions

View File

@ -264,7 +264,7 @@ const World = React.memo(function Map() {
}}
style={{
opacity: 1,
strokeOpacity: 0,
strokeOpacity: 1,
strokeWidth: 0,
}}
>

View File

@ -14,7 +14,7 @@
"message": "chore: publish"
}
},
"version": "2.0.36",
"version": "2.1.0",
"npmClient": "yarn",
"useWorkspaces": true,
"publishConfig": {

View File

@ -1,6 +1,6 @@
{
"name": "@antv/l7-component",
"version": "2.0.36",
"version": "2.1.0",
"description": "",
"main": "lib/index.js",
"module": "es/index.js",
@ -24,7 +24,7 @@
"author": "lzxue",
"license": "ISC",
"dependencies": {
"@antv/l7-core": "^2.0.36",
"@antv/l7-core": "^2.1.0",
"@antv/l7-utils": "^2.0.36",
"@babel/runtime": "^7.7.7",
"eventemitter3": "^4.0.0",

View File

@ -1,6 +1,6 @@
{
"name": "@antv/l7-core",
"version": "2.0.36",
"version": "2.1.0",
"description": "",
"main": "lib/index.js",
"module": "es/index.js",

View File

@ -61,6 +61,7 @@ export default class InteractionService extends EventEmitter
// hammertime.on('panmove', this.onPanmove);
// hammertime.on('panend', this.onPanend);
// hammertime.on('pinch', this.onPinch);
$containter.addEventListener('touchstart', this.onTouch);
$containter.addEventListener('mousemove', this.onHover);
$containter.addEventListener('click', this.onHover);
$containter.addEventListener('mousedown', this.onHover);
@ -85,6 +86,15 @@ export default class InteractionService extends EventEmitter
$containter.removeEventListener('contextmenu', this.onHover);
}
}
private onTouch = (target: TouchEvent) => {
const touch = target.touches[0];
// @ts-ignore
this.onHover({
x: touch.pageX,
y: touch.pageY,
type: 'touch',
});
};
private onHover = ({ x, y, type }: MouseEvent) => {
const $containter = this.mapService.getMapContainer();
@ -120,7 +130,9 @@ export default class InteractionService extends EventEmitter
}
return;
}
if (type === 'touch') {
type = 'click';
}
this.emit(InteractionEvent.Hover, { x, y, lngLat, type });
};
}

View File

@ -11,9 +11,10 @@
}
#map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
top: 0,
left: 0,
right: 0,
bottom: 0,
}
</style>
<link
@ -88,12 +89,16 @@
const scene = new L7.Scene({
id: "map",
map: new L7.Mapbox({
style: "dark", // 样式URL
style: "blank", // 样式URL
center: [ -96, 37.8 ],
zoom: 3,
pitch: 0,
})
});
})
scene.on('loaded',()=>{
alert('加载完成');
const color = [ 'rgb(255,255,217)', 'rgb(237,248,177)', 'rgb(199,233,180)', 'rgb(127,205,187)', 'rgb(65,182,196)', 'rgb(29,145,192)', 'rgb(34,94,168)', 'rgb(12,44,132)' ];
const layer = new L7.PolygonLayer({})
.source(data)
@ -115,6 +120,7 @@
opacity: 1.0
});
scene.addLayer(layer);
});
</script>
</body>
</html>

View File

@ -1,6 +1,6 @@
{
"name": "@antv/l7",
"version": "2.0.36",
"version": "2.1.0",
"description": "A Large-scale WebGL-powered Geospatial Data Visualization",
"main": "lib/index.js",
"module": "es/index.js",
@ -24,11 +24,11 @@
"author": "antv",
"license": "MIT",
"dependencies": {
"@antv/l7-component": "^2.0.36",
"@antv/l7-core": "^2.0.36",
"@antv/l7-layers": "^2.0.36",
"@antv/l7-maps": "^2.0.36",
"@antv/l7-scene": "^2.0.36",
"@antv/l7-component": "^2.1.0",
"@antv/l7-core": "^2.1.0",
"@antv/l7-layers": "^2.1.0",
"@antv/l7-maps": "^2.1.0",
"@antv/l7-scene": "^2.1.0",
"@babel/runtime": "^7.7.7"
},
"gitHead": "a5d354b66873f700730248d015c5e539c54b34b7",

View File

@ -1,6 +1,6 @@
{
"name": "@antv/l7-layers",
"version": "2.0.36",
"version": "2.1.0",
"description": "L7's collection of built-in layers",
"main": "lib/index.js",
"module": "es/index.js",
@ -23,8 +23,8 @@
"license": "ISC",
"dependencies": {
"@antv/async-hook": "^2.1.0",
"@antv/l7-core": "^2.0.36",
"@antv/l7-source": "^2.0.36",
"@antv/l7-core": "^2.1.0",
"@antv/l7-source": "^2.1.0",
"@antv/l7-utils": "^2.0.36",
"@babel/runtime": "^7.7.7",
"@mapbox/martini": "^0.1.0",

View File

@ -1,6 +1,6 @@
{
"name": "@antv/l7-maps",
"version": "2.0.36",
"version": "2.1.0",
"description": "",
"main": "lib/index.js",
"module": "es/index.js",
@ -23,7 +23,7 @@
"author": "xiaoiver",
"license": "ISC",
"dependencies": {
"@antv/l7-core": "^2.0.36",
"@antv/l7-core": "^2.1.0",
"@antv/l7-utils": "^2.0.36",
"@babel/runtime": "^7.7.7",
"@types/amap-js-api": "^1.4.6",

View File

@ -1,6 +1,6 @@
{
"name": "@antv/l7-react",
"version": "2.0.36",
"version": "2.1.0",
"description": "",
"main": "lib/index.js",
"module": "es/index.js",
@ -24,8 +24,8 @@
"author": "lzxue",
"license": "ISC",
"dependencies": {
"@antv/l7": "^2.0.36",
"@antv/l7-maps": "^2.0.36",
"@antv/l7": "^2.1.0",
"@antv/l7-maps": "^2.1.0",
"@babel/runtime": "^7.7.7",
"load-styles": "^2.0.0"
},

View File

@ -1,6 +1,6 @@
{
"name": "@antv/l7-renderer",
"version": "2.0.36",
"version": "2.1.0",
"description": "",
"main": "lib/index.js",
"module": "es/index.js",
@ -25,12 +25,12 @@
"gl": "^4.4.0"
},
"dependencies": {
"@antv/l7-core": "^2.0.36",
"@antv/l7-core": "^2.1.0",
"@babel/runtime": "^7.7.7",
"inversify": "^5.0.1",
"lodash": "^4.17.15",
"reflect-metadata": "^0.1.13",
"regl": "^1.3.11"
"regl": "1.3.11"
},
"gitHead": "a5d354b66873f700730248d015c5e539c54b34b7",
"publishConfig": {

View File

@ -1,6 +1,6 @@
{
"name": "@antv/l7-scene",
"version": "2.0.36",
"version": "2.1.0",
"description": "",
"main": "lib/index.js",
"module": "es/index.js",
@ -22,10 +22,10 @@
"author": "xiaoiver",
"license": "ISC",
"dependencies": {
"@antv/l7-component": "^2.0.36",
"@antv/l7-core": "^2.0.36",
"@antv/l7-maps": "^2.0.36",
"@antv/l7-renderer": "^2.0.36",
"@antv/l7-component": "^2.1.0",
"@antv/l7-core": "^2.1.0",
"@antv/l7-maps": "^2.1.0",
"@antv/l7-renderer": "^2.1.0",
"@antv/l7-utils": "^2.0.36",
"@babel/runtime": "^7.7.7",
"inversify": "^5.0.1",

View File

@ -1,6 +1,6 @@
{
"name": "@antv/l7-source",
"version": "2.0.36",
"version": "2.1.0",
"description": "",
"main": "lib/index.js",
"module": "es/index.js",
@ -25,7 +25,7 @@
"license": "ISC",
"dependencies": {
"@antv/async-hook": "^2.1.0",
"@antv/l7-core": "^2.0.36",
"@antv/l7-core": "^2.1.0",
"@antv/l7-utils": "^2.0.36",
"@babel/runtime": "^7.7.7",
"@mapbox/geojson-rewind": "^0.4.0",

View File

@ -90,9 +90,9 @@ const IndexPage = () => {
const notifications = [
{
type: t('推荐'),
title: t('如何用L7制作省市下钻疫情地图'),
date: '2020.01.31',
link: 'https://www.yuque.com/xiaofengcanyue/scpehq/zf094u',
title: t('如何制作不一样的疫情世界地图-酷炫、动感的地理可视化'),
date: '2020.03.12',
link: 'https://www.yuque.com/antv/blog/wigku2',
},
{
type: t('新版发布'),