本文整理汇总了TypeScript中leaflet.latLng函数的典型用法代码示例。如果您正苦于以下问题:TypeScript latLng函数的具体用法?TypeScript latLng怎么用?TypeScript latLng使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了latLng函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
example = () => {
L.polyline([
L.latLng(-37.7612, 175.2756),
L.latLng(-37.7702, 175.2796),
L.latLng(-37.7802, 175.2750),
]).bindLabel('Even polylines can have labels.').addTo(map);
};
示例2: it
it('returns a marker with latlng', () => {
const latlng = [-105, 35];
overlay.map = L.map(document.createElement('div'));
const marker = overlay.createMarkerPlaceholder(latlng);
expect(marker.getLatLng()).toEqual(L.latLng(latlng));
});
示例3: it
it('should call storage.set()', inject([MapViewService], (service: MapViewService) => {
const spy = spyOn(TestBed.get(LOCAL_STORAGE), 'set');
service.center = latLng(1.2, 3.4);
service.zoom = 10;
service.save();
expect(spy).toHaveBeenCalledWith('map-view', { lat: 1.2, lng: 3.4, zoom: 10 });
}));
示例4: icon
example = () => {
const myIcon = L.icon({
iconUrl: 'my-icon.png',
iconSize: L.point(20, 20),
iconAnchor: L.point(10, 10),
labelAnchor: L.point(6, 0) // as I want the label to appear 2px past the icon (10 + 2 - 6)
});
L.marker(L.latLng(-37.7772, 175.2606), {
icon: myIcon
}).bindLabel('Look revealing label!').addTo(map);
};
示例5: constructor
constructor(
private nav: NavController,
navParams: NavParams,
private geofenceService: GeofenceService,
private app: IonicApp
) {
this.geofenceService = geofenceService;
this.geofence = navParams.get("geofence");
this.transitionType = this.geofence.transitionType.toString();
this.notificationText = this.geofence.notification.text;
this._radius = this.geofence.radius;
this._latLng = Leaflet.latLng(this.geofence.latitude, this.geofence.longitude);
}
示例6: it
it('should return marker at the given position and heading', inject([MarkerService], (service: MarkerService) => {
const pilot = {
position: [32.149989, -110.835842],
aircraft: 'ZZZZ',
heading: 101,
callsign: 'FAKE_CALLSIGN',
} as Pilot;
const marker = service.aircraft(pilot);
expect(marker.getLatLng()).toEqual(latLng(32.149989, -110.835842));
expect(marker.options.rotationAngle).toEqual(101);
expect(marker.getTooltip()).toBeTruthy();
}));
示例7: it
it('should update the saved coordinates', () => {
let confidenceSpy,
latLng,
marker,
mapSpy,
markerSpy,
roundLocationSpy,
setCoordinatesSpy;
// set lat/lng object and marker
latLng = L.latLng(coordinates.latitude, coordinates.longitude);
marker = L.marker(latLng);
component.marker = marker;
// setup spies
confidenceSpy = spyOn(
coordinatesService,
'computeFromPoint'
).and.returnValue(coordinates.confidence);
markerSpy = spyOn(component.marker, 'getLatLng').and.returnValue(latLng);
mapSpy = spyOn(component.map, 'getZoom').and.returnValue(
coordinates.zoom
);
setCoordinatesSpy = spyOn(coordinatesService, 'setCoordinates');
roundLocationSpy = spyOn(
coordinatesService,
'roundLocation'
).and.returnValue(point);
// call onDragEnd
component.onDragEnd();
// check results
expect(markerSpy).toHaveBeenCalled();
expect(mapSpy).toHaveBeenCalled();
expect(confidenceSpy).toHaveBeenCalled();
expect(confidenceSpy).toHaveBeenCalledWith(coordinates.zoom);
expect(setCoordinatesSpy).toHaveBeenCalled();
expect(setCoordinatesSpy).toHaveBeenCalledWith({
confidence: coordinates.confidence,
latitude: coordinates.latitude,
longitude: coordinates.longitude,
method: coordinates.method,
zoom: coordinates.zoom
});
});
示例8: constructor
constructor(
private nav: NavController,
navParams: NavParams,
private geofenceService: GeofenceService,
private menu: MenuController,
private dataService: DataAccessService,
private events: Events
) {
this.geofenceService = geofenceService;
this.geofence = navParams.get("geofence");
console.log(Json.stringify(this.geofence));
this.transitionType = this.geofence.transitionType.toString();
this.notificationText = this.geofence.notification.text;
this._radius = this.geofence.radius;
this.crop = this.geofence.crop;
this._latLng = Leaflet.latLng(this.geofence.latitude, this.geofence.longitude);
}