Использование leaflet-easyPrint с приложением Typescript

Объекты Q , которые позволяют сложный поиск. Пример:

from django.db.models import Q

Item.objects.filter(Q(creator=owner) | Q(moderated=False))

0
задан Ionut Alixandroae 19 March 2019 в 15:13
поделиться

1 ответ

Я могу заставить это работать. Я сделал это:

В моих typings.d.ts

// Import Leaflet into L in case you want to reference Leaflet types
import * as L from 'leaflet';

// Declare the leaflet module so we can modify it
declare module 'leaflet' {

export interface IEasyPrintConstructorOptions {
  title: string;
  position: string;
  exportOnly: boolean;
  hideControlContainer: boolean;
  hidden:boolean;
}

export interface EasyPrint extends L.Control {
}

export function easyPrint(options?: IEasyPrintConstructorOptions): EasyPrint;

}

В app.component.ts:

import * as L from 'leaflet';
import 'leaflet-easyprint';

 //easyPrint initialization
 this.easyPrint = L.easyPrint({
  title: 'Print map',
  position: 'bottomright',
  exportOnly: true,
  hideControlContainer: true,
  hidden:true
}).addTo(map);

 //manually trigger export
 this.easyPrint.printMap('CurrentSize', 'Filename');

Это решение основано на коде, который вы поставить вопрос и https://asymmetrik.com/ngx-leaflet-and-leaflet-plugins/

0
ответ дан Gringo 19 March 2019 в 15:13
поделиться
Другие вопросы по тегам:

Похожие вопросы: