'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _feature = require('./feature');

var _feature2 = _interopRequireDefault(_feature);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

var Point = function Point(ctx, geojson) {
  _feature2['default'].call(this, ctx, geojson);
}; /**
    * @文件说明: 定义Point要素对象
    * @创建人: pjtools@vip.qq.com
    * @创建时间: 2020-05-27 18:32:49
    */

Point.prototype = Object.create(_feature2['default'].prototype);

Point.prototype.isValid = function () {
  return typeof this.coordinates[0] === 'number' && typeof this.coordinates[1] === 'number';
};

Point.prototype.updateCoordinate = function (pathOrLng, lngOrLat, lat) {
  if (arguments.length === 3) {
    this.coordinates = [lngOrLat, lat];
  } else {
    this.coordinates = [pathOrLng, lngOrLat];
  }
  this.changed();
};

Point.prototype.getCoordinate = function () {
  return this.getCoordinates();
};

exports['default'] = Point;