Giter VIP home page Giter VIP logo

Comments (10)

ahocevar avatar ahocevar commented on September 26, 2024 2

Note that in OpenLayers, you can always configure the MVT format with featureClass: ol.Feature to support that kind of thing.

from ol-mapbox-style.

ahocevar avatar ahocevar commented on September 26, 2024

The error occurs when OpenLayers wants to apply a text style to a polygon. Which is not a good idea with vector tiles, since polygons will be cut near (not even at) tile boundaries, and you will get repeated, cut-off and ugly looking labels. It is better to have label points in your vector tiles, and use those instead of on-the-fly calculated interior points.

from ol-mapbox-style.

aberenyi avatar aberenyi commented on September 26, 2024

@ahocevar fast and precise resolution, as always. Many thanks 👍

from ol-mapbox-style.

ahocevar avatar ahocevar commented on September 26, 2024

In the meantime, OpenLayers 4.5 is out, which has getInteriorPoint on ol.render.Feature.

from ol-mapbox-style.

pksorensen avatar pksorensen commented on September 26, 2024

I think this is a follow up - if i wanted to show points styles for each vertex in a linestring. Should I also include those in my vector tiles? Alot of dublicate data, is it not? atleast the geometry style for creating a multipoint feature with all vertexes is not working with ol.render.feature

from ol-mapbox-style.

ahocevar avatar ahocevar commented on September 26, 2024

atleast the geometry style for creating a multipoint feature with all vertexes is not working with ol.render.feature

What exactly are you referring to here?

from ol-mapbox-style.

pksorensen avatar pksorensen commented on September 26, 2024

sorry,

something like this:

 var vertexstyle = new ol.style.Style({
                    image: image,
                    geometry: function (feature: ol.render.Feature) {
                        let ls = (feature.getGeometry() as ol.geom.LineString); //this do not work on vectortiles
                        console.log(ls.getGeometry());
                      
                        var coordinates =ls.getCoordinates();
                        return new ol.geom.MultiPoint(coordinates);
                    }
                });

from ol-mapbox-style.

ahocevar avatar ahocevar commented on September 26, 2024

This is an OpenLayers question. But you're right, that does not work. Is there any mapbox-style property to render each vertex of a line?

from ol-mapbox-style.

pksorensen avatar pksorensen commented on September 26, 2024

ahh, sorry - i did not notice this was not in the openlayer repository.

I dont know about mapbox-styles, was just googling as i ran into my problem where I used to use the above kind of styling to do it on normal vector layers.

from ol-mapbox-style.

pksorensen avatar pksorensen commented on September 26, 2024

ahh, yes - that worked. thank you

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.