diff --git a/Map.php b/Map.php index 0d2e1d9..c02e3e9 100644 --- a/Map.php +++ b/Map.php @@ -1228,7 +1228,7 @@ public function setHeight( $height ) { * @return void */ public function setUnitsMetric() { - $this->setUnits( 'metric' ); + $this->setUnits( 'METRIC' ); } /** @@ -1237,7 +1237,7 @@ public function setUnitsMetric() { * @return void */ public function setUnitsImperial() { - $this->setUnits( 'imperial' ); + $this->setUnits( 'IMPERIAL' ); } /** @@ -1940,7 +1940,7 @@ function getMapJS() { $request_options .= sprintf( "\t\ttravelMode: google.maps.DirectionsTravelMode.%s,\n", strtoupper( $this->directions->request_options['travelMode'] ) ); break; case 'units': - $request_options .= sprintf( "\t\tunitSystem: google.maps.DirectionsUnitSystem.%s,\n", isset( $this->directions->request_options['units'] ) ?: $this->units ); + $request_options .= sprintf( "\t\tunitSystem: google.maps.DirectionsUnitSystem.%s,\n", isset( $this->directions->request_options['units'] ) ? $this->directions->request_options['units'] : $this->units ); break; default: $request_options .= sprintf( "\t\t%s:%s,\n", $request_option, $this->phpToJs( $request_value ) ); @@ -2392,4 +2392,4 @@ function enableClustering( $clustering_js_file, $options = null ) { $this->clustering_options = $options; } -} \ No newline at end of file +}