question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

vl-style-func not working

See original GitHub issue

Hi, we tried to use vl-style-func to style my points like that:

<vl-layer-vector>
 <vl-source-cluster v-bind:distance="15">
  <vl-source-vector v-bind:features="featuresMap.features" />
 </vl-source-cluster>
 <vl-style-func v-bind:function="clusterStyle" />
</vl-layer-vector>
clusterStyle() {
 return (feature) => {
  return new Style({
   image: new Circle({
   fill: new Fill({ color: "#fff" }),
   stroke: new Stroke({ color: "blue", width: 1.5 }),
   radius: 10,
  }),
  text: new Text({
   text: String(feature.get("features").length),
   }),
  });
 };
},

But nothing is displayed. For context we’re using vuelayers “0.12.0-rc.26”. Can please someone help us understanding how to use correctly the vl-style-func component?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ghettovoicecommented, Nov 23, 2021

Hello @BlazeRed ,

regarding your first question about style function:

in v0.12 vl-style-func now accepts style function instead of style function factory, so you need to adjust clusterStyle method:

clusterStyle(feature) { // take a not that method now is style function itself
    return new Style({
        image: new Circle({
            fill: new Fill({ color: "#fff" }),
            stroke: new Stroke({ color: "blue", width: 1.5 }),
            radius: 10,
        }),
        text: new Text({
            text: String(feature.get("features").length),
        }),
    });
},
0reactions
stale[bot]commented, Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

vl-interaction-select style - disable, style function #146 - GitHub
I tried vl-style-func component, but it does not seem to work. <vl-interaction-select :features.sync="selectedFeatures" ...
Read more >
vuelayers - Bountysource
Hello , I develop small project in HTML files. I import modules from CDN. When I add <vl-feature> it gives this error. What...
Read more >
vuelayers: Versions | Openbase
Fix several minor issues and merge of pull requests ... vl-style-func - component for advanced styling, can be used with any component that...
Read more >
vl-style-func not working #462 - bytemeta
vl-style-func not working #462. Hi, we tried to use vl-style-func to style my points like that: <vl-layer-vector> <vl-source-cluster v-bind:distance="15"> ...
Read more >
Module 10 (Unable to create VM using CLI) - IssueHint
Description of issue. Unable to create VM using CLI Error: VM customization is not enabled. ... vl-style-func not working, 6, 2021-11-18, 2022-10-29.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found