Skip to content

Several Icons on the same IconLayer #8163

Closed Answered by ventoline
ventoline asked this question in Q&A
Discussion options

You must be logged in to vote

thank you for your reply. I dont have a say in the route,i am given separate image files andneed attach them to the Icon.
This seems to work:

  new IconLayer({
        id: "trees",
      data: data2.features, 
      getIcon: d =>({ url:  icons[treeFam2Valid.indexOf(d.properties.family)],
     width: 128,
     height: 128,
     mask:true //needed for colors !!!
    }), 
      getPosition:  d => d.geometry.coordinates ,
      getSize: d => ((d.properties.CrownRad + 1) * 3 ),
      sizeScale: 1,
      sizeUnits : "meters",
      sizeMinPixels : 12,
      getAngle : d => (Math.random()*360 ),   
     
       getColor: d => (d.geometry.coordinates[1] < 43.6293  &&  d.geometry.coordinates[0] < …

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@Pessimistress
Comment options

@ventoline
Comment options

Answer selected by ventoline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants