Code Duplication    Length = 8-8 lines in 4 locations

src/Map.php 4 locations

@@ 1215-1222 (lines=8) @@
1212
            }
1213
        }
1214
1215
        if ($this->center != "auto") {
1216
            if ($this->is_lat_long($this->center)) { // if centering the map on a lat/long
1217
                $this->output_js_contents .= 'var myLatlng = new google.maps.LatLng('.$this->center.');';
1218
            } else {  // if centering the map on an address
1219
                $lat_long = $this->get_lat_long_from_address($this->center);
1220
                $this->output_js_contents .= 'var myLatlng = new google.maps.LatLng('.$lat_long[0].', '.$lat_long[1].');';
1221
            }
1222
        }
1223
1224
        $this->output_js_contents .= '
1225
				var myOptions = {
@@ 1639-1646 (lines=8) @@
1636
1637
                $placesLocationSet = true;
1638
1639
                if ($this->is_lat_long($this->placesLocationSW)) {
1640
                    $this->output_js_contents .= 'var placesLocationSW = new google.maps.LatLng('.$this->placesLocationSW.');
1641
			';
1642
                } else {  // if centering the map on an address
1643
                    $lat_long = $this->get_lat_long_from_address($this->placesLocationSW);
1644
                    $this->output_js_contents .= 'var placesLocationSW = new google.maps.LatLng('.$lat_long[0].', '.$lat_long[1].');
1645
			';
1646
                }
1647
1648
                if ($this->is_lat_long($this->placesLocationNE)) {
1649
                    $this->output_js_contents .= 'var placesLocationNE = new google.maps.LatLng('.$this->placesLocationNE.');
@@ 1648-1655 (lines=8) @@
1645
			';
1646
                }
1647
1648
                if ($this->is_lat_long($this->placesLocationNE)) {
1649
                    $this->output_js_contents .= 'var placesLocationNE = new google.maps.LatLng('.$this->placesLocationNE.');
1650
			';
1651
                } else {  // if centering the map on an address
1652
                    $lat_long = $this->get_lat_long_from_address($this->placesLocationNE);
1653
                    $this->output_js_contents .= 'var placesLocationNE = new google.maps.LatLng('.$lat_long[0].', '.$lat_long[1].');
1654
			';
1655
                }
1656
            }
1657
1658
            if (($placesLocationSet || $this->placesLocation != "") || count($this->placesTypes) || $this->placesName != "") {
@@ 1666-1673 (lines=8) @@
1663
						';
1664
                } else {
1665
                    if ($this->placesLocation != "") { // if search based on a center point
1666
                        if ($this->is_lat_long($this->placesLocation)) { // if centering the map on a lat/long
1667
                            $this->output_js_contents .= 'location: new google.maps.LatLng('.$this->placesLocation.')
1668
						';
1669
                        } else {  // if centering the map on an address
1670
                            $lat_long = $this->get_lat_long_from_address($this->placesLocation);
1671
                            $this->output_js_contents .= 'location: new google.maps.LatLng('.$lat_long[0].', '.$lat_long[1].')
1672
						';
1673
                        }
1674
                        $this->output_js_contents .= ',radius: '.$this->placesRadius.'
1675
						';
1676
                    }