2017-08-23 40 views
0

我想用ESRI單張購物車添加標記,使用ESRI傳單

我的代碼中添加使用mapbox標記添加標記給出如下:

var marker = L.marker(new L.LatLng(lat, long), { 
     icon: L.mapbox.marker.icon({ 
      'marker-color': 'ff8888' 
     }), 
     draggable: true 
     }); 
     marker.bindPopup('adresse'); 
     marker.addTo(map); 

我想用同樣的事通過使用esri傳單。

任何幫助,請

回答

0

你可以找到活ESRI小葉的例子風格使用L.icon這裏點要素:http://esri.github.io/esri-leaflet/examples/styling-feature-layer-points.html

L.esri.featureLayer({ 
    url: 'https://services.arcgis.com/rOo16HdIMeOBI4Mb/arcgis/rest/services/Trimet_Transit_Stops/FeatureServer/0', 
    pointToLayer: function (geojson, latlng) { 
    return L.marker(latlng, { 
     icon: L.icon({ 
     iconUrl: 'https://esri.github.io/esri-leaflet/img/bus-stop-north.png' 
     }) 
    }); 
    }, 
}).addTo(map);