Options
All
  • Public
  • Public/Protected
  • All
Menu

Package editor

XYZ Maps JS: Editor

XYZ Maps is an experimental and work in progress open-source map editor written in TypeScript/JavaScript. The editor module provides an API for editing map data that can be used to easily access, add, remove and edit various types of map data. Changes can be automatically synchronized with various remote backends services.

Links

Installation

Install XYZ Map Editor by using

# install using npm
npm install @here/xyz-maps-editor

or

# install using yarn
yarn add @here/xyz-maps-editor

Example Usage:

Create a map editor

import MapDisplay from '@here/xyz-maps-display';
import {Editor} from '@here/xyz-maps-editor';

const map = new MapDisplay( display, {
    zoomLevel : 18,
    center: {
        longitude: 8.53422,
        latitude: 50.16212
    },
    // add layers to the display
    layers: layerSetup
});

const editor = new Editor( map, {
    // add the layers that should be edited
    layers: layerSetup
});

Start developing

  1. Install node module dependencies

    yarn install
    

    In case yarn is not installed already: install yarn

  2. watch for source code changes and build dev version

    yarn run watch-dev
    

    Builds are located in located in ./dist/

Other

  • build dev version once yarn run build-dev (located in packages/*/dist/)

  • build release version only yarn run build-release (minified...)

License

Copyright (C) 2019-2022 HERE Europe B.V.

This project is licensed under the Apache License, Version 2.0 - see the LICENSE file for details

Index

Type aliases

CoordinatesUpdateHook

CoordinatesUpdateHook: (data: { feature: Feature; previousCoordinates: GeoJSONCoordinate | GeoJSONCoordinate[] | GeoJSONCoordinate[][] | GeoJSONCoordinate[][][] }) => void

The CoordinatesUpdateHook will be called whenever the coordinates of a feature are added, updated or removed ('Coordinates.update' operation).

Type declaration

EditorEventTypes

EditorEventTypes: "tap" | "dbltap" | "pointerup" | "pointerdown" | "pointerenter" | "pointerleave" | "featureUnselected" | "error" | "dragStart" | "dragStop"

The Possible types of an EditorEvent

FeatureRemoveHook

FeatureRemoveHook: (data: { feature: Feature }) => void

The FeatureRemoveHook will be called when a feature is being removed ('Feature.remove' operation).

Type declaration

    • (data: { feature: Feature }): void
    • Parameters

      • data: { feature: Feature }
        • feature: Feature

          the feature that is going to be removed

      Returns void

NavlinkDisconnectHook

NavlinkDisconnectHook: (data: { index: number; link: Navlink }) => void

The NavlinkDisconnectHook is called whenever a Navlink is disconnected from an intersection ('Navlink.disconnect' operation).

Type declaration

    • (data: { index: number; link: Navlink }): void
    • Parameters

      • data: { index: number; link: Navlink }
        • index: number

          The index of the coordinate that will be offset to "disconnect" the Navlink from the intersection

        • link: Navlink

          The Navlink that will be "disconnected" from the intersection

      Returns void

NavlinkSplitHook

NavlinkSplitHook: (data: { children: [Navlink, Navlink]; index: number; link: Navlink; relativePosition: number }) => void

The NavlinkSplitHook is called whenever a Navlink is devided into two new Navlinks. ('Navlink.split' operation).

Type declaration

    • Parameters

      • data: { children: [Navlink, Navlink]; index: number; link: Navlink; relativePosition: number }
        • children: [Navlink, Navlink]

          The two newly created Navlinks that are replacing the original Navlink.

        • index: number

          The index of the coordinate in which the split takes place and the new navlinks are connected to one another.

        • link: Navlink

          The Navlink that will be split.

        • relativePosition: number

          The relative position on the Navlink's geometry where the split happened. The range of values is from 0.0 to 1.0, where 0 represents the position on the first and 1 on the last coordinate.

      Returns void

RangeSegment

RangeSegment: { feature: GeoJSONFeature | Navlink; from: number; reversed: boolean; to: number }

A RangeSegment is the part of a "Range" that's located at a specific LineString geometry or Navlink feature.

Type declaration

  • feature: GeoJSONFeature | Navlink

    The GeoJSONFeature or Navlink the RangeSegment is located at.

  • from: number

    Relative start position on the geometry of the Navlink. 0 -> 0% -> start, 0.5 -> 50% -> middle, 1 -> 100% -> end

  • reversed: boolean

    The indicates if the direction of travel of the Navlink is in reverse order, compared to the direction of travel of the first Navlink that's has been added of the RangeSelector.

  • to: number

    Relative end position on the geometry of the Navlink. 0.5 -> 50% -> middle, 1 -> 100% -> end

Generated using TypeDoc