UNPKG

jupyterlab-emrys

Version:

A computational environment for Jupyter. Powered by Emrys

33 lines (32 loc) 894 B
// Copyright (c) Jupyter Development Team. // Distributed under the terms of the Modified BSD License. "use strict"; var docregistry_1 = require('../docregistry'); var widget_1 = require('./widget'); require('leaflet/dist/leaflet.css'); /** * The list of file extensions for maps. */ var EXTENSIONS = ['.geojson']; /** * The geojson file handler extension. */ exports.mapHandlerExtension = { id: 'jupyter.extensions.mapHandler', requires: [docregistry_1.DocumentRegistry], activate: activateMapWidget }; /** * Activate the map widget extension. */ function activateMapWidget(app, registry) { var options = { fileExtensions: EXTENSIONS, displayName: 'Map', modelName: 'text', defaultFor: EXTENSIONS, preferKernel: false, canStartKernel: false }; registry.addWidgetFactory(new widget_1.MapWidgetFactory(), options); }