本文整理汇总了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();