Deck.gl: Icon Layer icons are not rendered on map

Created on 9 Jul 2019  路  3Comments  路  Source: visgl/deck.gl

Description

I am trying to use the getIcon method and provide an external icon as a URL. It seems to be not rendering any marker on the map. In the following code ICON Mapping implementation with IconAtlas works without any issues but when I am trying to use getIcon method instead of IconAtlas and it seems to be not working for me.

Repro Steps



/** ICON MAPPING WORKS */
const ICON_MAPPING = {
  airplane : {
    x:0,
    y:0,
    width: 512,
    height: 512
    }
 }
/** ICON MAPPING WORKED  END */

new IconLayer({
    id: `path-layer-${fd.slice_id}`,
    data,
    getColor: d =>  sc,
    getPosition: d => {  return d.spatial;},


    /** ICON MAPPING WORKS */
    // sizeScale: 50,
    // iconAtlas : 'https://raw.githubusercontent.com/Swizec/webgl-airplanes-map/master/src/airplane-icon.jpg',
    // iconMapping: ICON_MAPPING,
    // getIcon:d=>"airplane",
    // getSize: d => 1,
    /** ICON MAPPING WORKED */

    /** Get ICON Implementation */
     getIcon: d => ({
       url:"https://raw.githubusercontent.com/Swizec/webgl-airplanes-map/master/src/airplane-icon.jpg",
       height:512,
       width: 512,
       mask:false,
     }),
     sizeScale: 50, 
     getSize: d => 1,
    /** Get ICON Implementation END*/

     opacity: 1,
     sizeMinPixels : 30,
     pickable: true,
     visible: true,

  });

Environment (please complete the following information):

  • Framework Version: [e.g. deck.gl 7.1.7]
  • Browser Version: [e.g. Chrome 75.0.3770.100 ]
  • OS: [e.g. Mac OS X 10.14.5]

Logs

bug

All 3 comments

@xintongxia Do you see any issues in the above code?

I tried with your icon params on my end and it is working. I don't know what is the data you are using, so I use our test data instead.

https://codesandbox.io/embed/sad-smoke-khth3

Closing due to inactivity and unable to reproduce any issue. Please reopen if you feel there is still an issue here.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Dieegho picture Dieegho  路  3Comments

jfuehner picture jfuehner  路  3Comments

euzu picture euzu  路  3Comments

TareqAlqutami picture TareqAlqutami  路  3Comments

mathieudelvaux picture mathieudelvaux  路  4Comments