function fitViewToMarkers(zoom, lat, lng, places) {

                if ((places && places.length > 0) && !(zoom || lat || lng)) {

                    var latLngs = places.map(function (place) {
                        if (place.location) {
                            return [place.location.lat, place.location.lon];
                        }
                    });

                    // Sets zoom, such that it is not too detailed when few entities are shown.
                    // Zooms out a little bit to prevent all markers being hidden behind menus on the side.
                    if (mapService.getMap().getZoom() > 9) {
                        mapService.getMap().fitBounds(latLngs).setZoom(9);
                    } else if (mapService.getMap().getZoom() > 4) {
                        mapService.getMap().fitBounds(latLngs).setZoom(mapService.getMap().getZoom() - 1);
                    } else
                        mapService.getMap().fitBounds(latLngs);
                }
            }
/**
             * Set the map's view:
             * fit bounds to entities only when zoom or coordinates are not explicitly
             * required by the url, else use the url settings
             */
Set the map's view:
fit bounds to entities only when zoom or coordinates are not explicitly
required by the url, else use the url settings
Set the map ' s view : fit bounds to entities only when zoom or coordinates are not explicitly required by the url else use the url settings
function fitViewToMarkers(zoom, lat, lng, places) {
                if ((places && places.length > 0) && !(zoom || lat || lng)) {
                    var latLngs = places.map(function (place) {
                        if (place.location) {
                            return [place.location.lat, place.location.lon];
                        }
                    });
                    if (mapService.getMap().getZoom() > 9) {
                        mapService.getMap().fitBounds(latLngs).setZoom(9);
                    } else if (mapService.getMap().getZoom() > 4) {
                        mapService.getMap().fitBounds(latLngs).setZoom(mapService.getMap().getZoom() - 1);
                    } else
                        mapService.getMap().fitBounds(latLngs);
                }
            }
function fitViewToMarkers ( zoom , lat , lng , places ) { if ( ( places && places . length > 0 ) && ! ( zoom || lat || lng ) ) { var latLngs = places . map ( function ( place ) { if ( place . location ) { return [ place . location . lat , place . location . lon ] ; } } ) ; if ( mapService . getMap ( ) . getZoom ( ) > 9 ) { mapService . getMap ( ) . fitBounds ( latLngs ) . setZoom ( 9 ) ; } else if ( mapService . getMap ( ) . getZoom ( ) > 4 ) { mapService . getMap ( ) . fitBounds ( latLngs ) . setZoom ( mapService . getMap ( ) . getZoom ( ) - 1 ) ; } else mapService . getMap ( ) . fitBounds ( latLngs ) ; } }
Set the map's view:
 fit bounds to entities only when zoom or coordinates are not explicitly
 required by the url, else use the url settings
Set the map ' s view : fit bounds to entities only when zoom or coordinates are not explicitly required by the url else use the url settings
// Sets zoom, such that it is not too detailed when few entities are shown. // Zooms out a little bit to prevent all markers being hidden behind menus on the side.