back | source
Geometries
  1. Line
    var geom1 = new longdo.Polyline([
      { lon: -45, lat: -45 },
      { lon: 105, lat: 15 }
    ]);
    map.Overlays.add(geom1);
    • Polyline(): This function is used to construct the straight line passing an array of coordinate of the line that you would like to construct to this function
    Example

  2. More information: Polyline Documentation

  3. Polygon
    var geom2 = new longdo.Polygon([
      { lon: 99, lat: 14 },
      { lon: 100, lat: 13 },
      { lon: 102, lat: 13 },
      { lon: 103, lat: 14 }
    ], {
      title: 'Geom 2',
      detail: '-',
      label: 'Trapezoid'
    });
    • Polygon(): This function is used to construct the polygon passing an array of coordinate of the corner that you would like to construct to this function
    • title: Message that will appear on the header of the popup
    • detail: Message that will appear on the detail of the popup
    • label: Message that will appear on the map
    Example

  4. More information: Polygon Documentation

  5. Circle
    var geom3 = new longdo.Circle({
      lon: 101, lat: 15
    }, 1, {
      title: 'Geom 3',
      detail: '-',
      lineWidth: 10,
      lineColor: 'rgba(0, 255, 0, 0.8)',
      fillColor: 'rgba(0, 255, 0, 0.4)',
      visibleRange: { min: 7, max: 8 },
      editable: true
    });
    • Circle(): This function is used to construct the circle passing a center of circle
    • lineWidth: Width of line
    • lineColor: Color of line
    • fillColor: Fill color (can't use with dashed line)
    • visibleRange: Visible range
    • editable: Can drag node to change geometry's shape
    Example

  6. More information: Circle Documentation

  7. Polycurve
    var geom4 = new longdo.Polycurve([
      { lon: 98, lat: 15 },
      { lon: 99, lat: 16 },
      { lon: 99, lat: 14 },
      { lon: 100, lat: 15 }
    ], {
      weight: longdo.OverlayWeight.Top
    });
    • Polycurve(): This function is used to construct the polycurve passing an array of coordinate of the cubic bezier that you would like to construct to this function
    • weight: If set an object with longdo.OverlayWeight.Top, the object will be on top of the layer.
    Example

  8. More information: Polycurve Documentation

  9. Dot
    var geom5 = new longdo.Dot({
      lon: 100.5, lat: 12.5
    }, {
      lineWidth: 20,
      draggable: true
    });
    • Dot(): This function is used to construct the dot passing a dot
    • lineWidth: Width of line
    • draggable: The overlay can be dragged
    Example

  10. More information: Dot Documentation

  11. Dashed line
    var geom6 = new longdo.Polyline([
      { lon: 100.9, lat: 16.3 },
      { lon: 102.7, lat: 15.2 },
      { lon: 104, lat: 17 }
    ], {
      lineStyle: longdo.LineStyle.Dashed,
      pointer: true
    });
    • lineStyle: If set an object with longdo.LineStyle.Dashed, the object will be dashed line.
    • pointer: Show pointer when move mouse over the line
    Example

  12. More information: LineStyle Documentation

  13. Donut
    var geom7 = new longdo.Polygon([
      { lon: 101, lat: 15 },
      { lon: 105, lat: 15 },
      { lon: 103, lat: 12 },
      null,
      { lon: 103, lat: 14.9 },
      { lon: 102.1, lat: 13.5 },
      { lon: 103.9, lat: 13.5 }
    ], {
      label: true,
      clickable: true
    });
    • label: Show label at pivot
    • clickable: Fire click event even if has no popup
    Example
  14. Rectangle
    var geom8 = new longdo.Rectangle({
      lon: 97, lat: 17
    }, {
      width: 2, height: 1
    }, {
      editable: true
    });
    • Rectangle(): This function is used to construct a rectangle and its parameters are a top-left point and size of the specific area
    Example

  15. More information: Rectangle Documentation

  16. Add Geometries
    map.Overlays.add(geom1);
    Example

  17. Remove Geometries
    map.Overlays.remove(geom1);
    Example

  18. Clear Geometries
    map.Overlays.clear();
    Example

    More information: OverlayCollection Documentation