本文整理匯總了TypeScript中leaflet.Polyline類的典型用法代碼示例。如果您正苦於以下問題:TypeScript Polyline類的具體用法?TypeScript Polyline怎麽用?TypeScript Polyline使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Polyline類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
],
[ // second polygon
[[41, -111.03], [45, -111.04], [45, -104.05], [41, -104.05]]
]
];
polygon = L.polygon(multiPolygonLatLngs);
polygon = new L.Polygon(multiPolygonLatLngs);
polygon.setLatLngs(multiPolygonLatLngs);
const multiPolygonLatLngs2: L.LatLng[][][] = polygon.getLatLngs() as L.LatLng[][][];
let polyline: L.Polyline;
// simple polyline
const simplePolylineLatLngs: L.LatLngExpression[] = [[45.51, -122.68], [37.77, -122.43], [34.04, -118.2]];
polyline = L.polyline(simplePolylineLatLngs);
polyline = new L.Polyline(simplePolylineLatLngs);
polyline.setLatLngs(simplePolylineLatLngs);
const simplePolylineLatLngs2: L.LatLng[] = polyline.getLatLngs() as L.LatLng[];
// multi polyline
const multiPolylineLatLngs: L.LatLngExpression[][] = [
[[45.51, -122.68], [37.77, -122.43], [34.04, -118.2]],
[[40.78, -73.91], [41.83, -87.62], [32.76, -96.72]]
];
polyline = L.polyline(multiPolylineLatLngs);
polyline = new L.Polyline(multiPolylineLatLngs);
polyline.setLatLngs(multiPolylineLatLngs);
const multiPolylineLatLngs2: L.LatLng[][] = polyline.getLatLngs() as L.LatLng[][];
const obj1 = {
prop1: 1,
示例2:
offset: new L.Point(0, 0),
opacity: 0.5,
zoomAnimation: true,
});
marker.showLabel();
marker.hideLabel();
marker.setLabelNoHide(true);
marker.updateLabelContent('test2');
label = marker.getLabel();
marker = marker.unbindLabel();
marker.setOpacity(0.5);
marker.setOpacity(0.5, true);
// Path
let path: L.Path = new L.Polyline([L.latLng(0, 0)]);
path = path.bindLabel('test', {
className: 'thingy',
clickable: true,
direction: 'right',
noHide: false,
offset: new L.Point(0, 0),
opacity: 0.5,
zoomAnimation: true,
});
path.updateLabelContent('test2');
path = path.unbindLabel();