Source: formats/wkt/geom/WktMultiPoint.js

  1. /*
  2. * Copyright 2003-2006, 2009, 2017, United States Government, as represented by the Administrator of the
  3. * National Aeronautics and Space Administration. All rights reserved.
  4. *
  5. * The NASAWorldWind/WebWorldWind platform is licensed under the Apache License, Version 2.0 (the "License");
  6. * you may not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. define([
  18. '../../../shapes/Placemark',
  19. '../../../shapes/PlacemarkAttributes',
  20. '../WktElements',
  21. './WktObject',
  22. './WktPoint',
  23. '../WktType'
  24. ], function (Placemark,
  25. PlacemarkAttributes,
  26. WktElements,
  27. WktObject,
  28. WktPoint,
  29. WktType) {
  30. /**
  31. * It represents multiple points.
  32. * @alias WktMultiPoint
  33. * @augments WktObject
  34. * @constructor
  35. */
  36. var WktMultiPoint = function () {
  37. WktObject.call(this, WktType.SupportedGeometries.MULTI_POINT);
  38. };
  39. WktMultiPoint.prototype = Object.create(WktObject.prototype);
  40. /**
  41. * Specific for Multi objects as it depicts the boundaries.
  42. */
  43. WktMultiPoint.prototype.commaWithoutCoordinates = function() {};
  44. /**
  45. * It returns Placemark for each point.
  46. * @inheritDoc
  47. * @return {Placemark[]}
  48. */
  49. WktMultiPoint.prototype.shapes = function() {
  50. return this.coordinates.map(function(coordinate){
  51. return WktPoint.placemark(coordinate);
  52. }.bind(this));
  53. };
  54. WktElements['MULTIPOINT'] = WktMultiPoint;
  55. return WktMultiPoint;
  56. });