fix: marker event

This commit is contained in:
thinkinggis 2020-04-07 11:24:59 +08:00
parent 5421f874b5
commit ce6eefdeb8
8 changed files with 8 additions and 10 deletions

View File

@ -79,7 +79,7 @@ const World = React.memo(function Map() {
).then((d) => d.json()), ).then((d) => d.json()),
// https://lab.isaaclin.cn/nCoV/api/area?latest=1 // https://lab.isaaclin.cn/nCoV/api/area?latest=1
fetch( fetch(
'https://gw.alipayobjects.com/os/bmw-prod/0676f102-22f6-4c75-ab12-1ae200834b1c.json', 'https://gw.alipayobjects.com/os/bmw-prod/55a7dd2e-3fb4-4442-8899-900bb03ee67a.json',
).then((d) => d.json()), ).then((d) => d.json()),
]); ]);
const worldData = joinData(geoData, ncovData.results); const worldData = joinData(geoData, ncovData.results);

View File

@ -88,7 +88,7 @@ const World = React.memo(function Map() {
).then((d) => d.json()), ).then((d) => d.json()),
// https://lab.isaaclin.cn/nCoV/api/area?latest=1 // https://lab.isaaclin.cn/nCoV/api/area?latest=1
fetch( fetch(
'https://gw.alipayobjects.com/os/bmw-prod/0676f102-22f6-4c75-ab12-1ae200834b1c.json', 'https://gw.alipayobjects.com/os/bmw-prod/55a7dd2e-3fb4-4442-8899-900bb03ee67a.json',
).then((d) => d.json()), ).then((d) => d.json()),
]); ]);
const worldData = joinData(geoData, ncovData.results); const worldData = joinData(geoData, ncovData.results);

View File

@ -73,7 +73,7 @@ const World = React.memo(function Map() {
).then((d) => d.json()), ).then((d) => d.json()),
// https://lab.isaaclin.cn/nCoV/api/area?latest=1 // https://lab.isaaclin.cn/nCoV/api/area?latest=1
fetch( fetch(
'https://gw.alipayobjects.com/os/bmw-prod/0676f102-22f6-4c75-ab12-1ae200834b1c.json', 'https://gw.alipayobjects.com/os/bmw-prod/55a7dd2e-3fb4-4442-8899-900bb03ee67a.json',
).then((d) => d.json()), ).then((d) => d.json()),
]); ]);
const worldData = joinData(geoData, ncovData.results); const worldData = joinData(geoData, ncovData.results);

View File

@ -72,7 +72,7 @@ const World = React.memo(function Map() {
).then((d) => d.json()), ).then((d) => d.json()),
// https://lab.isaaclin.cn/nCoV/api/area?latest=1 // https://lab.isaaclin.cn/nCoV/api/area?latest=1
fetch( fetch(
'https://gw.alipayobjects.com/os/bmw-prod/0676f102-22f6-4c75-ab12-1ae200834b1c.json', 'https://gw.alipayobjects.com/os/bmw-prod/55a7dd2e-3fb4-4442-8899-900bb03ee67a.json',
).then((d) => d.json()), ).then((d) => d.json()),
]); ]);
setData(joinData(geoData, ncovData.results)); setData(joinData(geoData, ncovData.results));

View File

@ -73,7 +73,7 @@ const World = React.memo(function Map() {
).then((d) => d.json()), ).then((d) => d.json()),
// https://lab.isaaclin.cn/nCoV/api/area?latest=1 // https://lab.isaaclin.cn/nCoV/api/area?latest=1
fetch( fetch(
'https://gw.alipayobjects.com/os/bmw-prod/0676f102-22f6-4c75-ab12-1ae200834b1c.json', 'https://gw.alipayobjects.com/os/bmw-prod/55a7dd2e-3fb4-4442-8899-900bb03ee67a.json',
).then((d) => d.json()), ).then((d) => d.json()),
]); ]);
setData(joinData(geoData, ncovData.results)); setData(joinData(geoData, ncovData.results));

View File

@ -82,7 +82,7 @@ const World = React.memo(function Map() {
).then((d) => d.json()), ).then((d) => d.json()),
// https://lab.isaaclin.cn/nCoV/api/area?latest=1 // https://lab.isaaclin.cn/nCoV/api/area?latest=1
fetch( fetch(
'https://gw.alipayobjects.com/os/bmw-prod/0676f102-22f6-4c75-ab12-1ae200834b1c.json', 'https://gw.alipayobjects.com/os/bmw-prod/55a7dd2e-3fb4-4442-8899-900bb03ee67a.json',
).then((d) => d.json()), ).then((d) => d.json()),
fetch( fetch(
'https://gw.alipayobjects.com/os/bmw-prod/8990e8b4-c58e-419b-afb9-8ea3daff2dd1.json', 'https://gw.alipayobjects.com/os/bmw-prod/8990e8b4-c58e-419b-afb9-8ea3daff2dd1.json',

View File

@ -59,7 +59,6 @@ export default class InteractionService extends EventEmitter
private addEventListenerOnMap() { private addEventListenerOnMap() {
const $containter = this.mapService.getMapContainer(); const $containter = this.mapService.getMapContainer();
Hammer.defaults.domEvents = true;
if ($containter) { if ($containter) {
const hammertime = new Hammer.Manager($containter); const hammertime = new Hammer.Manager($containter);
hammertime.add( hammertime.add(

View File

@ -73,9 +73,8 @@ export default class MarkerComponent extends React.Component {
scene.on('loaded', () => { scene.on('loaded', () => {
// @ts-ignore // @ts-ignore
marker.on('click', (e) => { // marker.on('click', (e) => {
console.log(this.scene.getZoom()); // });
});
// const marker1 = new AMap.Marker({ // const marker1 = new AMap.Marker({
// map: scene.map, // map: scene.map,
// position: [120.184824, 30.248341], // position: [120.184824, 30.248341],