Giter VIP home page Giter VIP logo

Comments (12)

ahocevar avatar ahocevar commented on June 24, 2024 1

@lukasmartinelli I think you can create a pull request against https://github.com/mapbox/mapbox-gl-style-spec. I'll take care of the formal requirements once you have submitted it. Just reference the pull request here.

from ol-mapbox-style.

ahocevar avatar ahocevar commented on June 24, 2024 1

@orangemug I still didn't find time to do this, but it's still high on my list.

from ol-mapbox-style.

ahocevar avatar ahocevar commented on June 24, 2024

Are you talking about e.g. https://github.com/mapbox/mapbox-gl-style-spec/blob/mb-pages/reference/v8.json? In general, I like the idea. I'm just wondering what would be the best way to implement it. Ideally, unsupported features would just be commented out, but JSON does not allow comments. On the other hand, if unsupported features are removed from the spec, it will be harder to add them back later. Do you have any thoughts on this?

from ol-mapbox-style.

lukasmartinelli avatar lukasmartinelli commented on June 24, 2024

Are you talking about e.g. https://github.com/mapbox/mapbox-gl-style-spec/blob/mb-pages/reference/v8.json?

Yes.

In general, I like the idea. I'm just wondering what would be the best way to implement it. Ideally, unsupported features would just be commented out, but JSON does not allow comments. On the other hand, if unsupported features are removed from the spec, it will be harder to add them back later. Do you have any thoughts on this?

Perhaps fork and add ol-mapbox-style the sdk-support field. This way we only annotate properties that are supported and do not delete/add anything to the spec.

          "sdk-support": {
            "basic functionality": {
              "js": "0.10.0",
              "android": "2.0.1",
              "ios": "2.0.0",
              "macos": "0.1.0"
            }

from ol-mapbox-style.

ahocevar avatar ahocevar commented on June 24, 2024

So you mean something like

      "sdk-support": {
        "basic functionality": {
          "js": "0.10.0",
          "android": "2.0.1",
          "ios": "2.0.0",
          "macos": "0.1.0",
          "ol-mapbox-style: "1.0.0"
        }
      }

I agree that doing this is the cleanest way. If you agree, before creating a fork, I'd create an upstream ticket with the suggestion - maybe it can even be added there.

from ol-mapbox-style.

lukasmartinelli avatar lukasmartinelli commented on June 24, 2024

I agree that doing this is the cleanest way. If you agree, before creating a fork, I'd create an upstream ticket with the suggestion - maybe it can even be added there.

Good idea, try that. I think the chances are not so big but upstream would be the best way.

from ol-mapbox-style.

orangemug avatar orangemug commented on June 24, 2024

Hey @ahocevar did you get anywhere with this? I noticed in mapbox/mapbox-gl-js#4170 (comment) you were planning to work on it.

Also congrats on the improvements to ol-mapbox-style I've been updating the dependency in https://github.com/maputnik/editor over the months and the map styles are starting to look really good.

from ol-mapbox-style.

orangemug avatar orangemug commented on June 24, 2024

Thanks for the response @ahocevar. I really want to get OpenLayers properly supported in Maputnik so anything I can do to help just shout. We've still got a little bit of work to do Maputnik side also, see https://github.com/maputnik/editor/issues?q=is%3Aissue+is%3Aopen+label%3Aopenlayers

Note: I had a look into this over the weekend, I was thinking visual regression type tests might be quite nice. Basically some GeoJSON + styling for each style rule that's in the Mapbox GL style spec.

from ol-mapbox-style.

orangemug avatar orangemug commented on June 24, 2024

Note: I had a look into this over the weekend, I was thinking visual regression type tests might be quite nice. Basically some GeoJSON + styling for each style rule that's in the Mapbox GL style spec.

@ahocevar I'm going to give this a go, see where I can get to. I've started over at https://maparatus.github.io/ol-mapbox-style-spec/ I'm going to build a bunch of test styles to see the visual differences between ol-mapbox-style/maplibre-gl later on maybe we could build this into some automated visual regression tests.

from ol-mapbox-style.

orangemug avatar orangemug commented on June 24, 2024

There are some interesting quirks, for example here I'd argue that ol/ol-mapbox-style does a better job (OpenLayers is on the right)

Screenshot from 2023-12-11 16-59-37

I'm currently unsure if the style-spec come with a caveat for OpenLayers

from ol-mapbox-style.

orangemug avatar orangemug commented on June 24, 2024

I've update https://maparatus.github.io/ol-mapbox-style-spec/ with a bunch more examples. Some notable differences

  • background - we currently set CSS on the background <div/> however the background should move with the camera. This isn't noticeable at the moment because we only set background-color (I tried adding background-pattern and noticed this).
  • *-pitch-* - OpenLayers doesn't have pitch so we can exclude these
  • raster-* - most of these should be possible with the approach outlined here #1055

from ol-mapbox-style.

orangemug avatar orangemug commented on June 24, 2024

Here is how the maplibre compatibility support is going so far, results are in the ol-mapbox-style-spec repo and the spec is at ./src/spec. That page also contains PR and issue links to this repo for various features missing/buggy.

Any feedback welcome (and encouraged)

Key for the results:

  • ❌ Not supported: not yet supported
  • 🏚️ Fallback: fill-extrusion emulates the 2D part of that spec for example
  • βœ… Supported: has same behaviour as maplibre to a large enough extent to considered supported

Results:

  • ❌ source_raster_dem.redFactor
  • ❌ source_raster_dem.blueFactor
  • ❌ source_raster_dem.greenFactor
  • ❌ source_raster_dem.baseShift
  • βœ… layer.type.values.fill
  • βœ… layer.type.values.line
  • βœ… layer.type.values.symbol
  • βœ… layer.type.values.circle
  • ❌ layer.type.values.heatmap
  • 🏚️ layer.type.values.fill-extrusion
  • βœ… layer.type.values.raster
  • βœ… layer.type.values.hillshade
  • βœ… layer.type.values.background
  • βœ… layout_background.visibility
  • βœ… layout_fill.fill-sort-key
  • βœ… layout_fill.visibility
  • βœ… layout_circle.circle-sort-key
  • βœ… layout_circle.visibility
  • ❌ layout_heatmap.visibility
  • 🏚️ layout_fill-extrusion.visibility
  • βœ… layout_line.line-cap
  • βœ… layout_line.line-join
  • βœ… layout_line.line-miter-limit
  • ❌ layout_line.line-round-limit
  • βœ… layout_line.line-sort-key
  • βœ… layout_line.visibility
  • ❌ layout_symbol.symbol-placement
  • ❌ layout_symbol.symbol-spacing
  • ❌ layout_symbol.symbol-avoid-edges
  • βœ… layout_symbol.symbol-sort-key
  • ❌ layout_symbol.symbol-z-order
  • βœ… layout_symbol.icon-allow-overlap
  • ❌ layout_symbol.icon-overlap
  • ❌ layout_symbol.icon-ignore-placement
  • ❌ layout_symbol.icon-optional
  • βœ… layout_symbol.icon-rotation-alignment
  • βœ… layout_symbol.icon-size
  • ❌ layout_symbol.icon-text-fit
  • ❌ layout_symbol.icon-text-fit-padding
  • βœ… layout_symbol.icon-image
  • βœ… layout_symbol.icon-rotate
  • ❌ layout_symbol.icon-padding
  • ❌ layout_symbol.icon-keep-upright
  • ❌ layout_symbol.icon-offset
  • βœ… layout_symbol.icon-anchor
  • ❌ layout_symbol.icon-pitch-alignment
  • ❌ layout_symbol.text-pitch-alignment
  • βœ… layout_symbol.text-rotation-alignment
  • βœ… layout_symbol.text-field
  • βœ… layout_symbol.text-font
  • βœ… layout_symbol.text-size
  • βœ… layout_symbol.text-max-width
  • βœ… layout_symbol.text-line-height
  • βœ… layout_symbol.text-letter-spacing
  • βœ… layout_symbol.text-justify
  • ❌ layout_symbol.text-radial-offset
  • ❌ layout_symbol.text-variable-anchor
  • ❌ layout_symbol.text-variable-anchor-offset
  • βœ… layout_symbol.text-anchor
  • βœ… layout_symbol.text-max-angle
  • ❌ layout_symbol.text-writing-mode
  • βœ… layout_symbol.text-rotate
  • βœ… layout_symbol.text-padding
  • ❌ layout_symbol.text-keep-upright
  • βœ… layout_symbol.text-transform
  • βœ… layout_symbol.text-offset
  • ❌ layout_symbol.text-allow-overlap
  • ❌ layout_symbol.text-overlap
  • ❌ layout_symbol.text-ignore-placement
  • ❌ layout_symbol.text-optional
  • βœ… layout_symbol.visibility
  • βœ… layout_raster.visibility
  • βœ… layout_hillshade.visibility
  • ❌ light.anchor
  • ❌ light.position
  • ❌ light.color
  • ❌ light.intensity
  • ❌ terrain.source
  • ❌ terrain.exaggeration
  • ❌ paint_fill.fill-antialias
  • βœ… paint_fill.fill-opacity
  • βœ… paint_fill.fill-color
  • βœ… paint_fill.fill-outline-color
  • ❌ paint_fill.fill-translate
  • ❌ paint_fill.fill-translate-anchor
  • βœ… paint_fill.fill-pattern
  • 🏚️ paint_fill-extrusion.fill-extrusion-opacity
  • 🏚️ paint_fill-extrusion.fill-extrusion-color
  • ❌ paint_fill-extrusion.fill-extrusion-translate
  • ❌ paint_fill-extrusion.fill-extrusion-translate-anchor
  • 🏚️ paint_fill-extrusion.fill-extrusion-pattern
  • ❌ paint_fill-extrusion.fill-extrusion-height
  • ❌ paint_fill-extrusion.fill-extrusion-base
  • ❌ paint_fill-extrusion.fill-extrusion-vertical-gradient
  • βœ… paint_line.line-opacity
  • βœ… paint_line.line-color
  • ❌ paint_line.line-translate
  • ❌ paint_line.line-translate-anchor
  • βœ… paint_line.line-width
  • ❌ paint_line.line-gap-width
  • ❌ paint_line.line-offset
  • ❌ paint_line.line-blur
  • βœ… paint_line.line-dasharray
  • ❌ paint_line.line-pattern
  • ❌ paint_line.line-gradient
  • βœ… paint_circle.circle-radius
  • βœ… paint_circle.circle-color
  • βœ… paint_circle.circle-blur
  • βœ… paint_circle.circle-opacity
  • βœ… paint_circle.circle-translate
  • ❌ paint_circle.circle-translate-anchor
  • ❌ paint_circle.circle-pitch-scale
  • ❌ paint_circle.circle-pitch-alignment
  • βœ… paint_circle.circle-stroke-width
  • βœ… paint_circle.circle-stroke-color
  • βœ… paint_circle.circle-stroke-opacity
  • ❌ paint_heatmap.heatmap-radius
  • ❌ paint_heatmap.heatmap-weight
  • ❌ paint_heatmap.heatmap-intensity
  • ❌ paint_heatmap.heatmap-color
  • ❌ paint_heatmap.heatmap-opacity
  • βœ… paint_symbol.icon-opacity
  • ❌ paint_symbol.icon-color
  • ❌ paint_symbol.icon-halo-color
  • ❌ paint_symbol.icon-halo-width
  • ❌ paint_symbol.icon-halo-blur
  • ❌ paint_symbol.icon-translate
  • ❌ paint_symbol.icon-translate-anchor
  • βœ… paint_symbol.text-opacity
  • βœ… paint_symbol.text-color
  • βœ… paint_symbol.text-halo-color
  • βœ… paint_symbol.text-halo-width
  • βœ… paint_symbol.text-halo-blur
  • βœ… paint_symbol.text-translate
  • ❌ paint_symbol.text-translate-anchor
  • βœ… paint_raster.raster-opacity
  • βœ… paint_raster.raster-hue-rotate
  • ❌ paint_raster.raster-brightness-min
  • ❌ paint_raster.raster-brightness-max
  • βœ… paint_raster.raster-saturation
  • ❌ paint_raster.raster-contrast
  • ❌ paint_raster.raster-resampling
  • ❌ paint_raster.raster-fade-duration
  • βœ… paint_hillshade.hillshade-illumination-direction
  • ❌ paint_hillshade.hillshade-illumination-anchor
  • βœ… paint_hillshade.hillshade-exaggeration
  • βœ… paint_hillshade.hillshade-shadow-color
  • βœ… paint_hillshade.hillshade-highlight-color
  • βœ… paint_hillshade.hillshade-accent-color
  • βœ… paint_background.background-color
  • ❌ paint_background.background-pattern
  • βœ… paint_background.background-opacity

from ol-mapbox-style.

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.