Git Product home page Git Product logo

Comments (1)

mhaertwig avatar mhaertwig commented on July 23, 2024

Umgesetzt in #17.

Das Styling der Zonen ist konfigurierbar. Selektierte Zonen können anders eingefärbt werden als nicht selektierte. Beispiel: https://trafimage-maps.netlify.com/#section-casa

Wir verbessern aktuell die Layer-Doku. Weil diese die neuen Parameter noch nicht enthält, hier eine kurz-Doku in Textform:

Beim Aufruf des Layers kann mit dem Attribut zoneStyle der globale Style der Zonen definiert werden.

  const zoneLayer = new ZoneLayer({
    token: '...',
    zoneStyle: {
      stroke: { width: 0 },
    },
  });

Per Default wird folgender Style verwendet:

    {
      fill: {
        color: 'rgb(255, 200, 25)',
      },
      stroke: {
        width: 2,
        color: 'black',
      },
      text: {
        font: '12px Arial',
        color: 'black',
      },
    };

Mit der neuen zoneStyleFunction kann das Styling der Zonen dynamisch geändert werden:

  const zoneLayer = new ZoneLayer({
    token: '...',
    zoneStyleFunction: (zoneProps, isSelected) => {
      return {
        fill: {
          color: isSelected ? 'red' : 'rgb(255, 200, 25)',
        },
      };
    },
  });

Was sagt Ihr zur API? Wenn Ihr Änderungswünsche habt, dann teilt uns diese gern mit.

from trafimage-maps.

Related Issues (9)

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.