【问题标题】:How do I change / color the icon / marker on the leaflet如何更改/着色传单上的图标/标记
【发布时间】:2021-01-31 05:00:40
【问题描述】:

如何更改/着色传单上的图标/标记,我使用 geojson,在这种情况下使用 2 个彼此不同的 geojson 面板和灯,这里我将给出 2 个 geojson,这是有问题的链接 https://tholabulilmi.info/apps/datasurvey/map.php?id=436 我希望标记/图标面板与光点不同,谢谢

enter code here (lampu geojson)

   
        # Pass Longitude and Latitude Columns here
        'coordinates' => array($row['longitude'], $row['latitude'])
    ),
    # Pass other attribute columns here
    'properties' => array(
        //'kode' => $row['kode'],
        //'marker-color' => '#e60f0f',
        'jenis_lampu' => $row['jenis_lampu'],
        'watt' => $row['watt'],
        'tiang' => $row['tiang'],
        'kabel' => $row['kabel'],
        'kondisi' => $row['kondisi'],
        'Date' => $row['Date'],
        //'tipe' => '1',
        'keterangan' => $row['keterangan']
        )
    );
# Add feature arrays to feature collection array
array_push($geojson['features'], $feature);

}

    # Pass other attribute columns here
    'properties' => array(
        //'marker-color' => '#e60f0f',
        'Idpel' => $row2['idpel'],
        'Rayon' => $row2['rayon'],
        'Daya' => $row2['daya'],
        'Alamat Lengkap' => $row2['alamat_lengkap'],
        'Date' => $row2['Date'],
        //'tipe' => '0',
        'Keterangan' => $row2['keterangan']
        )
    );
    array_push($geojson['features'], $feature);

【问题讨论】:

    标签: javascript php json leaflet geojson


    【解决方案1】:

    您可以使用此 repo 中的图像和说明:leaflet-colored-markers。关于如何将它们应用于 GeoJSON 中的点,您可以在此处阅读:Leaflet: how to use a custom marker on a geojson layer?

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-03
    • 1970-01-01
    • 1970-01-01
    • 2021-02-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多