packages/nlmaps/src/index.js
function setMapLoc(lib, opts, map) {
  let oldZoom;
  let view;
  switch (lib) {
    case 'leaflet':
      map.panTo([opts.lat,opts.lon]);
      if (opts.zoom){map.setZoom(opts.zoom)}
      break;
    case 'googlemaps':
      map.setCenter({lat: opts.lat,lng:opts.lon});
      if (opts.zoom) {map.setZoom(opts.zoom)}
      break;
    case 'openlayers':
      oldZoom = map.getView().getZoom();
      view = new ol.View({
          center: ol.proj.fromLonLat([opts.lon,opts.lat]),
          zoom: opts.zoom? opts.zoom: oldZoom
        });
      map.setView(view);
    }
}
function setMapLoc(lib, opts, map) {
  let oldZoom;
  let view;
  switch (lib) {
    case 'leaflet':
      map.panTo([opts.lat,opts.lon]);
      if (opts.zoom){map.setZoom(opts.zoom)}
      break;
    case 'googlemaps':
      map.setCenter({lat: opts.lat,lng:opts.lon});
      if (opts.zoom) {map.setZoom(opts.zoom)}
      break;
    case 'openlayers':
      oldZoom = map.getView().getZoom();
      view = new ol.View({
          center: ol.proj.fromLonLat([opts.lon,opts.lat]),
          zoom: opts.zoom? opts.zoom: oldZoom
        });
      map.setView(view);
    }
}
function setMapLoc ( lib , opts , map ) { let oldZoom ; let view ; switch ( lib ) { case 'leaflet' : map . panTo ( [ opts . lat , opts . lon ] ) ; if ( opts . zoom ) { map . setZoom ( opts . zoom ) } break ; case 'googlemaps' : map . setCenter ( { lat : opts . lat , lng : opts . lon } ) ; if ( opts . zoom ) { map . setZoom ( opts . zoom ) } break ; case 'openlayers' : oldZoom = map . getView ( ) . getZoom ( ) ; view = new ol . View ( { center : ol . proj . fromLonLat ( [ opts . lon , opts . lat ] ) , zoom : opts . zoom ? opts . zoom : oldZoom } ) ; map . setView ( view ) ; } }
can set center, with optional zoom. eslint-disable-next-line no-unused-vars
can set center with optional zoom . eslint - disable - next - line no - unused - vars