all files / src/olHelpers/ quickMap.ts

66.67% Statements 8/12
100% Branches 0/0
50% Functions 1/2
66.67% Lines 8/12
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38                                                           
/**
 * Created by gavorhes on 12/15/2015.
 */
 
import {quickMapOptions, quickMapBase} from './quickMapBase';
import provide from '../util/provide';
import mapMove from './mapMove';
import mapPopup from './mapPopup';
import ol = require('custom-ol');
let nm = provide('olHelpers');
 
/**
 * Sets up a map with some default parameters and initializes
 * mapMove and mapPopup
 *
 * @param {object} [options={}] config options
 * @param {string} [options.divId=map] map div id
 * @param {object} [options.center={}] center config object
 * @param {number} [options.center.x=-10018378] center x, web mercator x or lon
 * @param {number} [options.center.y=5574910] center y, web mercator y or lat
 * @param {number} [options.zoom=7] zoom level
 * @param {number} [options.minZoom=undefined] min zoom
 * @param {number} [options.maxZoom=undefined] max zoom
 * @param {boolean} [options.baseSwitcher=true] if add base map switcher
 * @param {boolean} [options.fullScreen=false] if add base map switcher
 * @returns {ol.Map} the ol map
 */
export function quickMap(options? : quickMapOptions): ol.Map {
    let m = quickMapBase(options);
    mapMove.init(m);
    mapPopup.init(m);
    return m;
}
 
 
nm.quickMap = quickMap;
export default quickMap;