當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript leaflet.latLng函數代碼示例

本文整理匯總了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);
};
開發者ID:AbraaoAlves,項目名稱:DefinitelyTyped,代碼行數:7,代碼來源:leaflet-label-tests.ts

示例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));
    });
開發者ID:ehunter-usgs,項目名稱:earthquake-eventpages,代碼行數:7,代碼來源:shake-alert-overlay.spec.ts

示例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 });
    }));
開發者ID:Vatsinator,項目名稱:Vatsinator,代碼行數:9,代碼來源:map-view.service.spec.ts

示例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);
};
開發者ID:AbraaoAlves,項目名稱:DefinitelyTyped,代碼行數:11,代碼來源:leaflet-label-tests.ts

示例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);
 }
開發者ID:lhammond,項目名稱:ionic2-geofence,代碼行數:13,代碼來源:geofence-details.ts

示例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();
    }));
開發者ID:Vatsinator,項目名稱:Vatsinator,代碼行數:13,代碼來源:marker.service.spec.ts

示例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
      });
    });
開發者ID:ehunter-usgs,項目名稱:hazdev-location-view,代碼行數:46,代碼來源:app.component.spec.ts

示例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);
 }
開發者ID:nisinha,項目名稱:farmapp,代碼行數:17,代碼來源:geofence-details.ts


注:本文中的leaflet.latLng函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。