Git Product home page Git Product logo

trafimage-maps's Introduction

trafimage-maps

npm code style: prettier

unit tests e2e chrome e2e firefox e2e edge

About

This repo contains the web component used by the Trafimage Map Portal by Swiss Federal Railways SBB and other applications build on it.

Documentation

See demo.

Technologies

  • web-component
  • react
  • redux
  • enzyme
  • jest
  • cypress
  • react-spatial
  • mobility-toolbox-js
  • eslint with airbnb
  • prettier
  • sass

Getting Started

Install:

yarn install

Start:

yarn start

Publish as NPM package

Make sure you're on the good branch.

Usually, public version are only published from master, beta version can be published from every branches.

Using the following commands, the release version number is automatically updated depending on commit messages (tanks conventionnal commit!)

  • Always test the changelog content before publishing:
yarn publish:public:dryrun
  • Publish a public version:
yarn login # only if it's not already done.
yarn publish:public
  • Publish a beta version:
yarn login # only if it's not already done.
yarn publish:beta

Udpate dependencies problems

[email protected]: We can't update after 11.0.8. 11.0.9 and 11.0.10 have the CopyWebpackPlugin bug. 11.0.11 have fixed it but another errors occurs when we run yarn doc. It seems jsx code is not well parsed anymore.

[email protected]: React 17 is not well supported by material-ui. In the tarifverbundkarte topic, the select box used to update the import format crashes the app when we click on it. The search component also have troubles when dev tools are open and try to navigate in the results with the keyboard.

[email protected]: Fixpack 4.0.0 returns an exit code of 1 everytime, so it breaks the lint-staged hook. See bug.

[email protected]: The version 6.7.0 has some dependencies for the module geotiff like txml that the compiler can't find.

babel-preset-react-app@9: The version 10.0.0 doesn't compile the same way the files in the build/es folder, it removed the option modules: false for the preset-env. That double the size of the code when we compile in a parent project.

trafimage-maps's People

Contributors

oterral avatar edellucien avatar gevos avatar danji90 avatar friedjoff avatar dependabot-preview[bot] avatar dependabot[bot] avatar lb1c avatar candux avatar zvyn avatar imgbot[bot] avatar renovate-bot avatar beneke090 avatar renovate[bot] avatar ulimueller avatar imgbotapp avatar trendels avatar

Stargazers

Máté Gyöngyösi avatar Ahmed Habib avatar Markus Unterkofler avatar Marek Siwek avatar Sven avatar Aurèle Bonvin avatar Mario Härtwig avatar Sebastian Steiner avatar Erdong avatar naheed avatar Tobias Bradtke avatar  avatar Wenuka Gunarathna avatar  avatar

Watchers

 avatar  avatar  avatar James Cloos avatar  avatar

trafimage-maps's Issues

Karte neu laden, wenn die Route ändert

Ich habe (leider) keine Ahnung von React

Aktuell rufe ich, jedes Mal wenn die Route ändert, diese Funktion auf:

function renderMap(routeData, zoneData, callbackName) {

    const layers = [];
    const elements = {};
    const token = 'myToken';

    const zoneLayer = new ZoneLayer({token: token});
    // Setup zoneLayer
    // ...
    layers.push(zoneLayer);

    const routeLayer = new RouteLayer({token: token});
    // Setup routeLayer
    // ...
    layers.push(routeLayer);

    ReactDOM.unmountComponentAtNode(document.getElementById('map-target-container'));
    ReactDOM.render(
        <div style={{position: 'relative', width: '100%', height: 500}}>
            <TrafimageMaps
                topics={[casa]}
                token={token}
                layers={layers}
                elements={elements}
            />
        </div>,
        document.getElementById('map-target-container')
    );
}

Das funktioniert so. Aber wenn ich den ReactDOM.unmountComponentAtNode Befehl weglasse, erhalte ich beim erneuten Rendern eine Fehlermeldung.

Gibt es eine bessere Lösung als die Komponente immer komplett aus dem DOM zu löschen?

ZoneLayer: Zone & Partner auslesen beim Click-Callback

Aktuell lese ich Zone und Partner Code wie folgt aus:

zoneLayer.onClick(e => {
    var zone = e[0].getProperties()['zone']
    var partnerCode = e[0].getProperties()['partner_code']
});

Geht's irgendwie sauberer? Oder ist das der richtige Weg?

Zonen (farblich) unterscheiden zwischen "selektiert" und "nicht selektiert".

In CASA unterscheiden wir bei Abos zwischen inkludierte Zonen und mögliche Zonen.

Inkludierte Zonen sind im gewählten Abo bereits enthalten.
Mögliche Zonen können optional dazu gewählt werden.
Wir müssen diese Zonen in der Karte (farblich) unterscheiden können. Diese Funktion konnte man in der "alten" Karte noch verwenden.

Beispiel von der alten Karte:
image

Problem with Platforms with local_ref with ";"

In the case of an interchange, for example from a train to a bus (in the case of defined lanes), the walking route takes you exactly to the lane where your bus will depart from.
Screenshot 01

If a platform has multiple lanes (for example local_ref=B;C) the path is not shown correctly.
Screenshot 02

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: baseBranch not found
Message: The following configured baseBranch could not be found: next

Keine Ortsbezeichnung je nach Zoomstufe

Je nach Zoomstufe werden mir auf der Karte keine Ortsbezeichnungen angezeigt. Das macht es mühsam, sich zurecht zu finden.

Hier als Beispiel, wenn ich in CASA von Bern nach Thun anfrage.

Language of Maps

When routing on sbb.ch the starting and ending points are in English and not in the user's language (printscreen 1 shows Track and Platform instead of "Gleis" and "Kante").

On Mobile SBB the departure and arrival points are translated, but (at least in Italian) they do not correspond to the SBB wordings. For example, instead of "Corsia" on the map appears "Marciapiede" (see printscreen 2).

Furthermore, the language of the sidewalks (in this case "Kante A") also does not match the language used on sbb.ch (see printscreen 3)

Screenshot 1:
Screenshot 1

Screenshot 2:
Screenshot 2

Screenshot 3:
Screenshot 3

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.