kepler.gl icon indicating copy to clipboard operation
kepler.gl copied to clipboard

Example JSON file for Icon

Open kk2491 opened this issue 5 years ago • 7 comments

Hi,

Could you please provide an example GeoJson file for creating Icon layers.

"type": "FeatureCollection",
"features": [
{
    "type": "Feature",
    "properties": {
        "style": {
            fillColor:'#669933',
            strokeColor:'red',
            strokeWidth:6,
            pointRadius:8
        },
        "icon": "car",
    },
    "geometry": {
        "type": "Point",
        "coordinates": [ -89.269113, 13.675143]
    }
}
]}

I have been trying to use the above format, however when I load the json to Kepler it is being selected as Polygon rather than Icon. Also loaded file is not getting visualized in the tool.

It would be great if you could help me with this regard.

Thank you,
KK

kk2491 avatar Mar 02 '21 05:03 kk2491

icon layer requires 3 columns latitude longitude and icon if you are using a geojson file, You need to add the point coordinate to the feature.properties

{
"type": "FeatureCollection",
"features": [
  {
    "type": "Feature",
    "properties": {
        "fillColor":'#669933',
         "strokeColor":'red',
         "strokeWidth":6,
         "pointRadius":8
         "latitude": 13.675143,
         "longitude": -89.269113,
         "icon": "car",
    },
    "geometry": {
        "type": "Point",
        "coordinates": [ -89.269113, 13.675143]
    }
  }
]}

heshan0131 avatar Mar 04 '21 06:03 heshan0131

Thanks for the answer, I will quickly check and let you know.

kk2491 avatar Mar 04 '21 06:03 kk2491

Hi @heshan0131 , I have used the below geojson file.

{
"type": "FeatureCollection",
"features": [
  {
    "type": "Feature",
    "properties": {
        "fillColor":"#669933",
         "strokeColor":"red",
         "strokeWidth":6,
         "pointRadius":180,
         "latitude": 13.675143,
         "longitude": -89.269113,
         "icon": "car"
    },
    "geometry": {
        "type": "Point",
        "coordinates": [ -89.269113, 13.675143]
    }
  }
]}

However, the attributes updated in the properties section is not being reflected in the visualization.

Above json creates 3 layers (Point, Polygon, Icon). I have attached the screenshots below.

image

image

image

I am trying to understand how can I update GeoJson file so that I can assign distinct colour to each of the icons.

Thank you, KK

kk2491 avatar Mar 07 '21 15:03 kk2491

@kk2491 because you have 3 levels make sure you hide point and polygons and you will see your car icon. See below:

Screen Shot 2021-03-19 at 4 15 20 PM

macrigiuseppe avatar Mar 19 '21 20:03 macrigiuseppe

@macrigiuseppe , we meet the same issue https://github.com/keplergl/kepler.gl/issues/1586 .but when adding filter by kepler side panel , icon would show ok without mouse hover .

chengzhangHu avatar Mar 24 '22 07:03 chengzhangHu