Giter Site home page Giter Site logo

Comments (5)

justb4 avatar justb4 commented on June 15, 2024

@sgofferj thanks for trying Wegue!
Helps when sharing your JSON config file (snippet) here and let us know if e.g. geometries and other attrs rendering works and what error messages you get, e.g. in browser console.
The API call above returns GeoJSON with nested properties, e.g. announcements is array-type. This structuring may not (yet) be supported by the OpenLayers VectorSource which is instantiated within the Wegue Layer Factory function. Could be that only 'flat' properties are supported.

from wegue.

sgofferj avatar sgofferj commented on June 15, 2024

If I use one of the flat attributes like "SituationId", it works. Although, it also seems to only display the points, not the MultiLineStrings. Here is the config part:

    {
      "type": "VECTOR",
      "lid": "Traffic",
      "name": "Traffic",
      "url": "https://tie.digitraffic.fi/api/v3/data/traffic-messages/simple?inactiveHours=0&includeAreaGeometry=true&situationType=TRAFFIC_ANNOUNCEMENT",
      "formatConfig": {
      },
      "format": "GeoJSON",
      "visible": true,
      "selectable": true,
      "hoverable": true,
      "hoverAttribute": "announcements[0].title",
      "style": {
        "radius": 4,
        "strokeColor": "red",
        "strokeWidth": 5,
        "fillColor": "rgba(155,153,51,0.5)",
        "label": {
          "attribute": "situationId",
          "minResolution": 4.0,
          "outlineColor": "white",
          "outlineWidth": 2,
          "fillColor": "black",
          "offsetX": 0,
          "offsetY": 15,
          "align": "center"
        }
      },
      "selectStyle": {
        "radius": 10,
        "strokeColor": "gray",
        "strokeWidth": 5,
        "fillColor": "rgb(255, 255, 0, 0.2)"
      },
      "doAppendSelectStyle": true
    },

Ah, so that's all from Openlayers. I'm not familiar with that at all. I have tinkered with Leaflet before.

from wegue.

fschmenger avatar fschmenger commented on June 15, 2024

Hi @sgofferj,
as @justb4 pointed out, the default tooltip only supports plain attributes. You can hovever accomplish this by implementing a custom map overlay as documented in the reusable-component section.

from wegue.

justb4 avatar justb4 commented on June 15, 2024

Also the GeoJSON returned from the API has "mixed" geometries: null, MultiLineString and Point.
Don't know how that would be rendered by the Style. This GeoJSON validator: https://www.itb.ec.europa.eu/json/geojson/upload does not seem to be allowing null when validating as GeoJSON FeatureCollection.

from wegue.

sgofferj avatar sgofferj commented on June 15, 2024

Oh, I see. I see how easy Vue is to understand then :).

from wegue.

Related Issues (20)

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.