Giter VIP home page Giter VIP logo

xyz-maps's Introduction

XYZ Maps JS

License Actions Status Actions Status npm version

XYZ Maps is an experimental and work in progress open-source map editor written in TypeScript/JavaScript.

edit buildings with xyz-editor

Overview

XYZ Maps consists of the following main modules:

  • @here/xyz-maps-common : The Common module provides commonly used javascript functionality that is required by all other modules of XYZ Maps.
  • @here/xyz-maps-core : The Core module provides the most basic functionality. Main functionalities of the module are: DataProviders, TileLayers, Geometric Classes and Styling definitions.
  • @here/xyz-maps-display : The Display module is a highly customizable vector map display that's optimized for map editing, larger raw datasets and frequently changing data.
  • @here/xyz-maps-editor : 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.

Prerequisites

Start developing

  1. Clone this repository

    git clone https://github.com/heremaps/xyz-maps.git
    
    cd xyz-maps
    
  2. Install node module dependencies

    yarn install
    
  3. watch for source code changes and build dev version

    yarn run watch-dev
    

    Builds are located in ./packages/*/dist/

Setup your XYZ token

Setup an XYZ token is only required if the XYZ Hub endpoint at xyz.api.here.com is used. You can get a token by following the instructions in this guide.

If you are using a local XYZ Hub simply set set-access-token to an empty string.

Running integration tests / playground and debug pages requires the XYZ token to be provided.

  • Configure your XYZ token
    yarn run set-access-token YOUR_ACCESS_TOKEN
    

Serve debug page

Serve Playground

Other Commands

  • Run tests on release build yarn run test

  • Build development version yarn run build-dev (located in docs/)

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

  • Build the documentation yarn run build-doc (located in packages/docs/dist/)

  • Create full release bundle yarn run bundle-release (includes documentation and playground)

  • Configure XYZ access token yarn run set-access-token YOUR_ACCESS_TOKEN

Guides

License

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

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

xyz-maps's People

Contributors

dependabot[bot] avatar haifeng2013 avatar terminaltim avatar tsteenbe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xyz-maps's Issues

Is LUI available somewhere?

This is a little bit unrelated to this repo, but I noticed a neat UI framework being used on https://xyz.api.here.com/token-ui/, called "LUI", and I see custom elements in the page named with the prefix lui-.

The UI looks very nice!

I was wondering if this UI kit is available anywhere? If not, are there any plans to open-source it?

As an experiment, I was able to place the script https://xyz.api.here.com/token-ui/js/lui-all.min.js onto my own page, and play with some components, but this comes with no documentation (and may be of questionable legality).

The LUI framework looks very interesting. It'd be neat to use it!

Transparent backgrounds

I'm trying to overlay an xyz-maps Map instance over a vector map rendered using MapLibre (but this is also reproducible when trying to get the background color / image of the Map's container to bleed through).

Prior to 071ff56, I was able to make the background transparent while keeping features rendered at full opacity using the following diff (quick and dirty; there were surely side-effects I wasn't seeing):

diff --git i/packages/display/src/displays/BasicDisplay.ts w/packages/display/src/displays/BasicDisplay.ts
index 2b4f6ef..7aa15ca 100644
--- i/packages/display/src/displays/BasicDisplay.ts
+++ w/packages/display/src/displays/BasicDisplay.ts
@@ -572,13 +572,19 @@ abstract class Display {
             bgColor == 'rgba(0, 0, 0, 0)' || // webkit
             bgColor == 'transparent' // firefox, ie
         ) {
             bgColor = '#ffffff';
         }
 
+        bgColor = color || 'rgba(0, 0, 0, 0)';
+
         bgColor = render.convertColor(bgColor);
 
         displ.globalBgc = bgColor;
 
         render.setBackgroundColor(bgColor);
     }
 
diff --git i/packages/display/src/displays/webgl/GLRender.ts w/packages/display/src/displays/webgl/GLRender.ts
index d5d4b74..d5edb91 100644
--- i/packages/display/src/displays/webgl/GLRender.ts
+++ w/packages/display/src/displays/webgl/GLRender.ts
@@ -196,7 +196,7 @@ export class GLRender implements BasicRender {
     setBackgroundColor(color: RGBA) {
         // this.clearColor = color;
         if (this.gl) {
-            this.gl.clearColor(color[0], color[1], color[2], 1.0);
+            this.gl.clearColor(color[0], color[1], color[2], color[3]);
         }
     }
 
diff --git i/packages/display/src/displays/webgl/program/Program.ts w/packages/display/src/displays/webgl/program/Program.ts
index d31e1a7..bcd3845 100644
--- i/packages/display/src/displays/webgl/program/Program.ts
+++ w/packages/display/src/displays/webgl/program/Program.ts
@@ -35,7 +35,7 @@ type AttributeMap = { [name: string]: Attribute | ConstantAttribute };
 type ColorMask = { r: boolean; g: boolean; b: boolean; a: boolean };
 
 const DEFAULT_COLOR_MASK: ColorMask = {
-    r: true, g: true, b: true, a: false
+    r: true, g: true, b: true, a: true
 };
 
 const NO_COLOR_MASK: ColorMask = {

With bd1d34e (HEAD), I can make the background almost transparent (this.gl.clearColor(color[0], color[1], color[2], color[3] || 1.0) means providing a color with an alpha component of 0.0 results in a value of 1.0), but it applies the background's transparency value to everything that's rendered (presumably because of a color mask that's different from 071ff56).

editor.createFeatureContainer(features) doesn't work as advertised

createFeatureContainer fails when features are passed to the builder:

const feature = editor.getFeature("<id>", layer);
editor.createFeatureContainer([feature]);
xyz-maps-editor.min.js:19 Uncaught TypeError: e.getProvider is not a function
    at e.add (xyz-maps-editor.min.js:19:114888)
    at e.push (xyz-maps-editor.min.js:19:92660)
    at e.createFeatureContainer (xyz-maps-editor.min.js:21:10611)
    at index.js:178:30
    at t.trigger (xyz-maps-common.min.js:5:5183)
    at x (xyz-maps-display.min.js:5:186164)
    at Tn.onPointerUp (xyz-maps-display.min.js:5:187068)

This works fine:

const feature = editor.getFeature("<id>", layer);
const container = editor.createFeatureContainer();
container.push(feature);

Docs still uses references from DH Console which is retired

XYZ Maps docs still refers to using XYZ Token In Readme.md and Docs pages which is currently failing with 404,

Setup your XYZ token
Setup an XYZ token is only required if the XYZ Hub endpoint at xyz.api.here.com is used. You can get a token by following the instructions in this guide.

If you are using a local XYZ Hub simply set set-access-token to an empty string.

Running integration tests / playground and debug pages requires the XYZ token to be provided.

Configure your XYZ token
yarn run set-access-token YOUR_ACCESS_TOKEN

FireFox mouse wheel zoom very slow

FireFox, Windows 10. Zooming with mouse wheel is very slow.

Setting display behaviour to "fixed" workarounds the problem as one mouse wheel click is one zoom level in every browser.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.