本文整理匯總了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);
}