Helper method for map-creation.

@param {string} divId The id of the div for the map.
@return {Map} The map instance.
482625
function createMap(divId) {
  const source = new OSM();
  const layer = new TileLayer({
    source: source
  });
  const map = new Map({
    layers: [layer],
    target: divId,
    view: new View({
      center: [0, 0],
      zoom: 2
    })
  });
  const zoomslider = new ZoomSlider();
  map.addControl(zoomslider);
  return map;
}
890149
public static <K, V> Map<K, V> newMap(Map<K, V> initMap) {
        return new HashMap<>(initMap);
    }
364190
public static <V> Map<SNode, V> createSNodeMapFromIDs(Map<String, V> map,
    SDocumentGraph graph)
  {
    HashMap<SNode, V> result = new LinkedHashMap<>();

    if (map != null && graph != null)
    {
      for (Map.Entry<String, V> e : map.entrySet())
      {
        SNode n = graph.getNode(e.getKey());
        if (n != null)
        {
          result.put(n, e.getValue());
        }
      }
    }

    return result;
  }
1063423
public static <K, V> Map<K, V> newFilteredMap(Map<K, V> map,
            Predicate<? super Entry<K, V>> filter) {
        return getEntryStreamWithFilter(map, filter)
                .collect(toMap(Entry::getKey, Entry::getValue));
    }
878268
private MapController createMapController(Map map, final GraphicsController controller, String id) {
		MapController mapController;
		if (ToolId.TOOL_MEASURE_DISTANCE_MODE.equalsIgnoreCase(id)) {
			mapController = new MeasureDistanceInfoControllerImpl(map, (MeasureDistanceController) controller);
		} else {
			mapController = new MapController(map, controller);
		}
		mapController.setActivationHandler(new ExportableFunction() {

			public void execute() {
				controller.onActivate();
			}
		});
		mapController.setDeactivationHandler(new ExportableFunction() {

			public void execute() {
				controller.onDeactivate();
			}
		});
		return mapController;
	}
290572
public JQMListItem addDiv(String html) {
        Element e = Document.get().createDivElement();
        e.setInnerHTML(html);
        attachChild(e);
        return this;
    }
1372862
public static Map getOrCreateChildMap(Map parent, String key) {
        Object o = parent.get(key);
        if(o instanceof Map) {
            return (Map)o;
        }
        return new LinkedHashMap();
    }
1304865
function mapOptions() {
          return {
            element: element[0],
            scope: 'usa',
            height: scope.height,
            width: scope.width,
            fills: { defaultFill: '#b9b9b9' },
            data: {},
            done: function (datamap) {
              function redraw() {
                datamap.svg.selectAll('g').attr('transform', 'translate(' + d3.event.translate + ')scale(' + d3.event.scale + ')');
              }
              if (angular.isDefined(attrs.onClick)) {
                datamap.svg.selectAll('.datamaps-subunit').on('click', function (geography) {
                  scope.onClick()(geography);
                });
              }
              if (angular.isDefined(attrs.zoomable)) {
                datamap.svg.call(d3.behavior.zoom().on('zoom', redraw));
              }
            }
          };
        }
747906
function (id) {
  var module = dem(id);
  var fragments = id.split('.');
  var target = Function('return this;')();
  for (var i = 0; i < fragments.length - 1; ++i) {
    if (target[fragments[i]] === undefined)
      target[fragments[i]] = {};
    target = target[fragments[i]];
  }
  target[fragments[fragments.length - 1]] = module;
}
104290
public static BigDecimal div(String v1, String v2, int scale, RoundingMode roundingMode) {
		return div(new BigDecimal(v1), new BigDecimal(v2), scale, roundingMode);
	}
102993
function getDocObject(dir, info) {
  const markdown = getReadmeText(dir);
  const html = marked(markdown);
  const cleanedHTML = prepareHTML(html, info);
  return { pkg: dir, html: cleanedHTML };
}
997237
function (id) {
		var container = this._container = L.DomUtil.get(id);

		if (!container) {
			throw new Error('Map container not found.');
		} else if (container._leaflet) {
			throw new Error('Map container is already initialized.');
		}

		L.DomEvent.addListener(container, 'scroll', this._onScroll, this);
		container._leaflet = true;
	}
865053
function createTile(coords, done) {
    let key = this._tileCoordsToKey(coords);
    
    let tileContainer = L.DomUtil.create("div");
    tileContainer.dataset.pending = this._imagesPerTile;
    
    for ( let i = 0; i < this._imagesPerTile; i++ ) {
      let key2 = key + "/" + i;
      if ( key2 in this._freshTiles ) {
        tileContainer.appendChild(this._freshTiles[ key2 ].pop());
        if ( !this._freshTiles[ key2 ].length ) {
          delete this._freshTiles[ key2 ];
        }
        tileContainer.dataset.pending--;
        // 				console.log('Got ', key2, ' from _freshTiles');
      } else {
        this._tileCallbacks[ key2 ] = this._tileCallbacks[ key2 ] || [];
        this._tileCallbacks[ key2 ].push(
          (function(c /* , k2*/) {
            return function(imgNode) {
              let parent = imgNode.parentNode;
              if ( parent ) {
                parent.removeChild(imgNode);
                parent.removeChild = L.Util.falseFn;
                // 							imgNode.parentNode.replaceChild(L.DomUtil.create('img'), imgNode);
              }
              c.appendChild(imgNode);
              c.dataset.pending--;
              if ( !parseInt(c.dataset.pending) ) {
                done();
              }
              // 						console.log('Sent ', k2, ' to _tileCallbacks, still ', c.dataset.pending, ' images to go');
            };
          })(tileContainer /* , key2*/)
        );
      }
    }
    
    if ( !parseInt(tileContainer.dataset.pending) ) {
      L.Util.requestAnimFrame(done);
    }
    return tileContainer;
  }
700482
function mapCacheSet(key, value) {
    var data = getMapData(this, key),
      size = data.size;

    data.set(key, value);
    this.size += data.size == size ? 0 : 1;
    return this;
  }
190225
function MapType(attrs, opts) {
  Type.call(this);

  if (!attrs.values) {
    throw new Error(f('missing map values: %j', attrs));
  }
  this._values = createType(attrs.values, opts);

  // Addition by Edwin Elia
  var keys = attrs.keys;
  if (!keys) {
    keys = 'string';
  }
  this._keys = createType(keys, opts);
}
412429
public static <K, V> Map<K, V> newMap(Map<K, V> map) {
        return Optional.ofNullable(map).map(HashMap::new)
                .orElseGet(HashMap::new);
    }
785198
function create(content, url) {
  url = url || '<source>';
  const map = new SourceMapGenerator({ file: url });
  const lines = content.split('\n');

  for (let l = 1, n = lines.length; l <= n; l++) {
    // Skip empty
    if (lines[l - 1]) {
      map.addMapping({
        source: url,
        original: { line: l, column: 0 },
        generated: { line: l, column: 0 }
      });
    }
  }

  map.setSourceContent(url, content);
  return map;
}