How to use the geojs.mapInteractor function in geojs

To help you get started, we’ve selected a few geojs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DigitalSlideArchive / HistomicsTK / web_client / views / visualization.js View on Github external
_createMap: function (bounds, tileWidth, tileHeight, sizeX, sizeY) {
        if (this._map) {
            // reset bounds query parameter on map exit
            router.setQuery('bounds', null, {replace: true, trigger: false});
            this._map.exit();
        }
        bounds.left = bounds.left || 0;
        bounds.top = bounds.top || 0;
        tileWidth = tileWidth || (bounds.right - bounds.left);
        tileHeight = tileHeight || (bounds.bottom - bounds.top);
        sizeX = sizeX || (bounds.right - bounds.left);
        sizeY = sizeY || (bounds.bottom - bounds.top);
        var interactor = geo.mapInteractor({
            zoomAnimation: false
        });
        var mapW = this.$el.width() || 100, mapH = this.$el.height() || 100;
        var minZoom = Math.min(0, Math.floor(Math.log(Math.min(
                (mapW || tileWidth) / tileWidth,
                (mapH || tileHeight) / tileHeight)) / Math.log(2))),
            maxZoom = Math.ceil(Math.log(Math.max(
                sizeX / tileWidth,
                sizeY / tileHeight)) / Math.log(2));

        var mapParams = {
            node: '<div style="width: 100%; height: 100%">',
            width: mapW,
            height: mapH,
            ingcs: '+proj=longlat +axis=esu',
            gcs: '+proj=longlat +axis=enu',</div>
github Kitware / minerva / web_external / views / map / MapPanel.js View on Github external
renderMap: function () {
        if (!this.map) {
            var mapSettings = this.session.metadata().map;
            this.map = geo.map({
                node: '.m-map-panel-map',
                center: mapSettings.center,
                zoom: mapSettings.zoom,
                max: 21,
                interactor: geo.mapInteractor({
                    map: this.map,
                    click: {
                        enabled: true,
                        cancelOnMove: true
                    }
                })
            });
            var interactorOpts = this.map.interactor().options();
            interactorOpts.keyboard.focusHighlight = false;
            this.map.interactor().options(interactorOpts);
            this.map.createLayer(mapSettings.basemap,
                _.has(mapSettings, 'basemap_args')
                    ? mapSettings.basemap_args
                    : {});
            this.uiLayer = this.map.createLayer('ui');
            this.controlsUiLayer = this.map.createLayer('ui');