Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drawing line labels #42

Open
parinporecha opened this issue Oct 9, 2015 · 0 comments
Open

Drawing line labels #42

parinporecha opened this issue Oct 9, 2015 · 0 comments

Comments

@parinporecha
Copy link

Hi, I could not find any example for drawing road labels. I tried modifying the india-label example -

    if (feature.layer.name === 'addresspoint') {
      console.log('Found layer = ' + feature.layer.name);
      style.staticLabel = function() {
        var style = {
          html: feature.properties.BLDG_NUM,
          iconSize: [33,33],
          cssClass: 'label-icon-text'
        };
        return style;
      };
    }

    if (feature.layer.name === 'roadlabel') {
      console.log('Found layer = ' + feature.layer.name);
      style.staticLabel = function() {
        var style = {
          html: feature.properties.NAME,
          iconSize: [33,33],
          cssClass: 'label-icon-text'
        };
        return style;
      };
    }

The addresspoints get displayed correctly, because they are of the type Point.
address labels

But the roadlabels being of type LineString do not get displayed. I face the same problem with labels of type Polygon.

So how do I show labels other than Point type?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant