• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript leaflet.latLng函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript leaflet.layerGroup函数代码示例发布时间:2022-05-25
下一篇:
TypeScript leaflet.imageOverlay函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap