protected function generateJavaScript($mapId, array $mapPoints, $initializeFunctionName)
    {
        // Note: If there are several map points with coordinates and the map
        // is fit to the map points, the Google Maps API still requires a center
        // point. In that case, any point will do (e.g., the first point).
        $centerCoordinates = $mapPoints[0]->getGeoCoordinates();

        return 'var mapMarkersByUid = mapMarkersByUid || {};' . LF .
            'function ' . $initializeFunctionName . '() {' . LF .
            'var center = new google.maps.LatLng(' . \number_format($centerCoordinates['latitude'], 6, '.', '') . ', ' .
            \number_format($centerCoordinates['longitude'], 6, '.', '') . ');' . LF .
            'var mapOptions = {' . LF .
            '  mapTypeId: google.maps.MapTypeId.ROADMAP,' . LF .
            '  scrollwheel: false, ' . LF .
            '  zoom: ' . self::DEFAULT_ZOOM_LEVEL . ', ' . LF .
            '  center: center' . LF .
            '};' . LF .
            'mapMarkersByUid.' . $mapId . ' = {};' . LF .
            'var map = new google.maps.Map(document.getElementById("' . $mapId . '"), mapOptions);' . LF .
            'var bounds = new google.maps.LatLngBounds();' . LF .
            $this->createMapMarkers($mapPoints, $mapId) .
            '}';
    }
protected function generateJavaScript($mapId, array $mapPoints, $initializeFunctionName)
    {
        // Note: If there are several map points with coordinates and the map
        // is fit to the map points, the Google Maps API still requires a center
        // point. In that case, any point will do (e.g., the first point).
        $centerCoordinates = $mapPoints[0]->getGeoCoordinates();

        return 'var mapMarkersByUid = mapMarkersByUid || {};' . LF .
            'function ' . $initializeFunctionName . '() {' . LF .
            'var center = new google.maps.LatLng(' . \number_format($centerCoordinates['latitude'], 6, '.', '') . ', ' .
            \number_format($centerCoordinates['longitude'], 6, '.', '') . ');' . LF .
            'var mapOptions = {' . LF .
            '  mapTypeId: google.maps.MapTypeId.ROADMAP,' . LF .
            '  scrollwheel: false, ' . LF .
            '  zoom: ' . self::DEFAULT_ZOOM_LEVEL . ', ' . LF .
            '  center: center' . LF .
            '};' . LF .
            'mapMarkersByUid.' . $mapId . ' = {};' . LF .
            'var map = new google.maps.Map(document.getElementById("' . $mapId . '"), mapOptions);' . LF .
            'var bounds = new google.maps.LatLngBounds();' . LF .
            $this->createMapMarkers($mapPoints, $mapId) .
            '}';
    }
protected function generateJavaScript ( $ mapId , array $ mapPoints , $ initializeFunctionName ) { // Note: If there are several map points with coordinates and the map // is fit to the map points, the Google Maps API still requires a center // point. In that case, any point will do (e.g., the first point). $ centerCoordinates = $ mapPoints [ 0 ] -> getGeoCoordinates ( ) ; return 'var mapMarkersByUid = mapMarkersByUid || {};' . LF . 'function ' . $ initializeFunctionName . '() {' . LF . 'var center = new google.maps.LatLng(' . \ number_format ( $ centerCoordinates [ 'latitude' ] , 6 , '.' , '' ) . ', ' . \ number_format ( $ centerCoordinates [ 'longitude' ] , 6 , '.' , '' ) . ');' . LF . 'var mapOptions = {' . LF . '  mapTypeId: google.maps.MapTypeId.ROADMAP,' . LF . '  scrollwheel: false, ' . LF . '  zoom: ' . self :: DEFAULT_ZOOM_LEVEL . ', ' . LF . '  center: center' . LF . '};' . LF . 'mapMarkersByUid.' . $ mapId . ' = {};' . LF . 'var map = new google.maps.Map(document.getElementById("' . $ mapId . '"), mapOptions);' . LF . 'var bounds = new google.maps.LatLngBounds();' . LF . $ this -> createMapMarkers ( $ mapPoints , $ mapId ) . '}' ; }
Generates the JavaScript for the Google Map.

@param string $mapId
HTML ID of the map, must not be empty
@param \Tx_Oelib_Interface_MapPoint[] $mapPoints
map points with coordinates, must not be empty
@param string $initializeFunctionName
name of the JavaScript initialization function to create, must
not be empty

@return string the generated JavaScript, will not be empty
Generates the JavaScript for the Google Map .