diff --git a/src/geometry/ext/Geometry.Edit.ts b/src/geometry/ext/Geometry.Edit.ts index 82d8f9bc6d..1318250e16 100644 --- a/src/geometry/ext/Geometry.Edit.ts +++ b/src/geometry/ext/Geometry.Edit.ts @@ -1,6 +1,6 @@ import Geometry from '../Geometry'; import GeometryEditor from '../editor/GeometryEditor'; -import { isNil } from '../../core/util'; +// import { isNil } from '../../core/util'; export type GeometryEditSymbolType = { 'markerType': string, 'markerFill': string, diff --git a/src/geometry/ext/Geometry.Events.ts b/src/geometry/ext/Geometry.Events.ts index 381988a055..ee06364fb9 100644 --- a/src/geometry/ext/Geometry.Events.ts +++ b/src/geometry/ext/Geometry.Events.ts @@ -74,7 +74,7 @@ Geometry.include(/** @lends Geometry.prototype */ { // eventParam['coordinate'] = map.containerPointToCoordinate(containerPoint); // eventParam['containerPoint'] = containerPoint; // eventParam['viewPoint'] = map.containerPointToViewPoint(containerPoint); - // eventParam['pont2d'] = map._containerPointToPoint(containerPoint); + // eventParam['point2d'] = map._containerPointToPoint(containerPoint); // } // return eventParam; // } diff --git a/src/map/Map.DomEvents.ts b/src/map/Map.DomEvents.ts index 027c4828c8..3fdf7b59a2 100644 --- a/src/map/Map.DomEvents.ts +++ b/src/map/Map.DomEvents.ts @@ -450,7 +450,7 @@ Map.include(/** @lends Map.prototype */ { eventParam['coordinate'] = map.containerPointToCoordinate(containerPoint); eventParam['containerPoint'] = containerPoint; eventParam['viewPoint'] = map.containerPointToViewPoint(containerPoint); - eventParam['pont2d'] = map._containerPointToPoint(containerPoint); + eventParam['point2d'] = map._containerPointToPoint(containerPoint); } this._wrapTerrainData(eventParam); return eventParam; diff --git a/test/geometry/event/GeometryEventSpec.js b/test/geometry/event/GeometryEventSpec.js index 2ff3cb52b2..7739db9e1f 100644 --- a/test/geometry/event/GeometryEventSpec.js +++ b/test/geometry/event/GeometryEventSpec.js @@ -564,4 +564,23 @@ describe('Geometry.Events', function () { }); + it('#2386 Geometry event result point2d attribute typo ', function (done) { + var circle = new maptalks.Circle(map.getCenter(), 10); + circle.addTo(layer); + var domPosition = GET_PAGE_POSITION(container); + var point = map.coordinateToContainerPoint(center).add(domPosition); + // var spy = sinon.spy(); + circle.on('click', (e) => { + expect(e).to.have.property('point2d'); + expect(e.point2d).to.be.an(maptalks.Point); + done(); + }); + + happen.click(eventContainer, { + 'clientX': point.x, + 'clientY': point.y + }); + + }); + });