Skip to content

Minor tweaks to controls positioning and disabling #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions application/libraries/Googlemaps.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class Googlemaps {
var $disableDefaultUI = FALSE; // If set to TRUE will hide the default controls (ie. zoom, scale etc)
var $disableDoubleClickZoom = FALSE; // If set to TRUE will disable zooming when a double click occurs
var $disableMapTypeControl = FALSE; // If set to TRUE will hide the MapType control (ie. Map, Satellite, Hybrid, Terrain)
var $disableZoomControl = FALSE; // If set to TRUE will hide the Zoom control
var $disablePanControl = FALSE; // If set to TRUE will hide the Pan control
var $disableNavigationControl = FALSE; // If set to TRUE will hide the Navigation control (ie. zoom in/out, pan)
var $disableScaleControl = FALSE; // If set to TRUE will hide the Scale control
var $disableStreetViewControl = FALSE; // If set to TRUE will hide the Street View control
Expand Down Expand Up @@ -77,6 +79,7 @@ class Googlemaps {
var $onrightclick = ''; // The JavaScript action to perform when the map is right-clicked
var $ontilesloaded = ''; // The JavaScript action to perform when the visible tiles have finished loading
var $onzoomchanged = ''; // The JavaScript action to perform when the maps zoom property changes
var $panControlPosition = ''; // The position of the Pan control when viewing normal aerial map, eg. 'TOP_LEFT'
var $panoramio = FALSE; // If TRUE will add photos from Panoramio as a layer to your maps as a series of large and small photo icons
var $panoramioTag = ''; // Restrict the set of Panoramio photos shown to those matching a certain textual tag
var $panoramioUser = ''; // Restrict the set of Panoramio photos shown to those matching a particular user
Expand Down Expand Up @@ -1249,6 +1252,14 @@ function create_map()
$this->output_js_contents .= ',
mapTypeControl: false';
}
if ($this->disableZoomControl) {
$this->output_js_contents .= ',
zoomControl: false';
}
if ($this->disablePanControl) {
$this->output_js_contents .= ',
panControl: false';
}
if ($this->disableNavigationControl) {
$this->output_js_contents .= ',
navigationControl: false';
Expand Down Expand Up @@ -1334,6 +1345,10 @@ function create_map()
$this->output_js_contents .= ',
scaleControlOptions: {position: google.maps.ControlPosition.'.strtoupper($this->scaleControlPosition).'}';
}
if ($this->panControlPosition!="") {
$this->output_js_contents .= ',
panControlOptions: {position: google.maps.ControlPosition.'.strtoupper($this->panControlPosition).'}';
}
if (!$this->scrollwheel) {
$this->output_js_contents .= ',
scrollwheel: false';
Expand Down