diff --git a/application/libraries/Googlemaps.php b/application/libraries/Googlemaps.php index dce2327..ab02470 100644 --- a/application/libraries/Googlemaps.php +++ b/application/libraries/Googlemaps.php @@ -15,76 +15,76 @@ class Googlemaps { - var $adsense = FALSE; // Whether Google Adsense For Content should be enabled + var $adsense = FALSE; // Whether Google Adsense For Content should be enabled var $adsenseChannelNumber = ''; // The Adsense channel number for tracking the performance of this AdUnit - var $adsenseFormat = 'HALF_BANNER'; // The format of the AdUnit - var $adsensePosition = 'TOP_CENTER'; // The position of the AdUnit + var $adsenseFormat = 'HALF_BANNER'; // The format of the AdUnit + var $adsensePosition = 'TOP_CENTER'; // The position of the AdUnit var $adsensePublisherID = ''; // Your Google AdSense publisher ID var $backgroundColor = ''; // A hex color value shown as the map background when tiles have not yet loaded as the user pans var $bicyclingOverlay = FALSE; // If set to TRUE will overlay bicycling information (ie. bike paths and suggested routes) onto the map by default - var $center = "37.4419, -122.1419"; // Sets the default center location (lat/long co-ordinate or address) of the map. If defaulting to the users location set to "auto" - var $cluster = FALSE; // Whether to cluster markers + var $center = "37.4419, -122.1419"; // Sets the default center location (lat/long co-ordinate or address) of the map. If defaulting to the users location set to "auto" + var $cluster = FALSE; // Whether to cluster markers var $clusterGridSize = 60; // The grid size of a cluster in pixels - var $clusterMaxZoom = ''; // The maximum zoom level that a marker can be part of a cluster + var $clusterMaxZoom = ''; // The maximum zoom level that a marker can be part of a cluster var $clusterZoomOnClick = TRUE; // Whether the default behaviour of clicking on a cluster is to zoom into it var $clusterAverageCenter = FALSE; // Whether the center of each cluster should be the average of all markers in the cluster - var $clusterMinimumClusterSize = 2; // The minimum number of markers to be in a cluster before the markers are hidden and a count is shown + var $clusterMinimumClusterSize = 2; // The minimum number of markers to be in a cluster before the markers are hidden and a count is shown 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 $disableNavigationControl = FALSE; // If set to TRUE will hide the Navigation control (ie. zoom in/out, pan) + 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 - var $draggable = TRUE; // If set to FALSE will prevent the map from being dragged around + var $disableStreetViewControl = FALSE; // If set to TRUE will hide the Street View control + var $draggable = TRUE; // If set to FALSE will prevent the map from being dragged around var $draggableCursor = ''; // The name or url of the cursor to display on a draggable object - var $draggingCursor = ''; // The name or url of the cursor to display when an object is being dragged - var $geocodeCaching = FALSE; // If set to TRUE will cache any geocode requests made when an address is used instead of a lat/long. Requires DB table to be created (see documentation) - var $https = FALSE; // If set to TRUE will load the Google Maps JavaScript API over HTTPS, allowing you to utilize the API within your HTTPS secure application - var $navigationControlPosition = ''; // The position of the Navigation control, eg. 'BOTTOM_RIGHT' + var $draggingCursor = ''; // The name or url of the cursor to display when an object is being dragged + var $geocodeCaching = FALSE; // If set to TRUE will cache any geocode requests made when an address is used instead of a lat/long. Requires DB table to be created (see documentation) + var $https = FALSE; // If set to TRUE will load the Google Maps JavaScript API over HTTPS, allowing you to utilize the API within your HTTPS secure application + var $navigationControlPosition = ''; // The position of the Navigation control, eg. 'BOTTOM_RIGHT' var $keyboardShortcuts = TRUE; // If set to FALSE will disable to map being controlled via the keyboard - var $jsfile = ''; // Set this to the path of an external JS file if you wish the JavaScript to be placed in a file rather than output directly into the
section. The library will try to create the file if it does not exist already. Please ensure the destination file is writeable - var $kmlLayerURL = ''; // A URL to publicly available KML or GeoRSS data for displaying geographic information - var $kmlLayerPreserveViewport = FALSE; // Specifies whether the map should be adjusted to the bounds of the KmlLayer's contents. By default the map is zoomed and positioned to show the entirety of the layer's contents - var $language = ''; // The map will by default load in the language of the browser. This can be overriden however here. For a full list of codes see https://spreadsheets.google.com/pub?key=p9pdwsai2hDMsLkXsoM05KQ&gid=1 + var $jsfile = ''; // Set this to the path of an external JS file if you wish the JavaScript to be placed in a file rather than output directly into the section. The library will try to create the file if it does not exist already. Please ensure the destination file is writeable + var $kmlLayerURL = ''; // A URL to publicly available KML or GeoRSS data for displaying geographic information + var $kmlLayerPreserveViewport = FALSE; // Specifies whether the map should be adjusted to the bounds of the KmlLayer's contents. By default the map is zoomed and positioned to show the entirety of the layer's contents + var $language = ''; // The map will by default load in the language of the browser. This can be overriden however here. For a full list of codes see https://spreadsheets.google.com/pub?key=p9pdwsai2hDMsLkXsoM05KQ&gid=1 var $loadAsynchronously = FALSE; // Load the map and API asynchronously once the page has loaded - var $map_div_id = "map_canvas"; // The ID of the that is output which contains the map - var $map_height = "450px"; // The height of the map container. Any units (ie 'px') can be used. If no units are provided 'px' will be presumed - var $map_name = "map"; // The JS reference to the map. Currently not used but to be used in the future when multiple maps are supported - var $map_type = "ROADMAP"; // The default MapType. Values accepted are 'HYBRID', 'ROADMAP', 'SATELLITE' or 'TERRAIN' + var $map_div_id = "map_canvas"; // The ID of the that is output which contains the map + var $map_height = "450px"; // The height of the map container. Any units (ie 'px') can be used. If no units are provided 'px' will be presumed + var $map_name = "map"; // The JS reference to the map. Currently not used but to be used in the future when multiple maps are supported + var $map_type = "ROADMAP"; // The default MapType. Values accepted are 'HYBRID', 'ROADMAP', 'SATELLITE' or 'TERRAIN' var $map_types_available = array(); // The other MapTypes available for selection on the map - var $map_width = "100%"; // The width of the map container. Any units (ie 'px') can be used. If no units are provided 'px' will be presumed + var $map_width = "100%"; // The width of the map container. Any units (ie 'px') can be used. If no units are provided 'px' will be presumed var $mapTypeControlPosition = ''; // The position of the MapType control, eg. 'BOTTOM_RIGHT' var $mapTypeControlStyle = ''; // The style of the MapType control. blank, 'DROPDOWN_MENU' or 'HORIZONTAL_BAR' values accepted. - var $minzoom = ''; // The minimum zoom level which will be displayed on the map - var $maxzoom = ''; // The maximum zoom level which will be displayed on the map - var $minifyJS = FALSE; // If TRUE will run the JavaScript through Jsmin.php (this file and PHP5+ required) to minify the code - var $noClear = FALSE; // If TRUE do not clear the contents of the map div + var $minzoom = ''; // The minimum zoom level which will be displayed on the map + var $maxzoom = ''; // The maximum zoom level which will be displayed on the map + var $minifyJS = FALSE; // If TRUE will run the JavaScript through Jsmin.php (this file and PHP5+ required) to minify the code + var $noClear = FALSE; // If TRUE do not clear the contents of the map div var $onboundschanged = ''; // The JavaScript action to perform when the viewport bounds have changed var $oncenterchanged = ''; // The JavaScript action to perform when themap center property changes - var $onclick = ''; // The JavaScript action to perform when the map is clicked - var $ondblclick = ''; // The JavaScript action to perform when the map is double-clicked - var $ondrag = ''; // The JavaScript action to perform while the map is dragged - var $ondragend = ''; // The JavaScript action to perform when the user stops dragging the map - var $ondragstart = ''; // The JavaScript action to perform when the user starts dragging the map - var $onidle = ''; // The JavaScript action to perform when the map becomes idle after panning or zooming - var $onload = ''; // The JavaScript action to perform when the map first loads. This library hi-jacks the window.load event so add any bespoke code using this option - var $onmousemove = ''; // The JavaScript action to perform when the user's mouse moves over the map container - var $onmouseout = ''; // The JavaScript action to perform when the user's mouse exits the map container - var $onmouseover = ''; // The JavaScript action to perform when the user's mouse enters the map container - var $onresize = ''; // The JavaScript action to perform when the maps div changes size - 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 $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 - var $region = ''; // Country code top-level domain (eg "uk") within which to search. Useful if supplying addresses rather than lat/longs + var $onclick = ''; // The JavaScript action to perform when the map is clicked + var $ondblclick = ''; // The JavaScript action to perform when the map is double-clicked + var $ondrag = ''; // The JavaScript action to perform while the map is dragged + var $ondragend = ''; // The JavaScript action to perform when the user stops dragging the map + var $ondragstart = ''; // The JavaScript action to perform when the user starts dragging the map + var $onidle = ''; // The JavaScript action to perform when the map becomes idle after panning or zooming + var $onload = ''; // The JavaScript action to perform when the map first loads. This library hi-jacks the window.load event so add any bespoke code using this option + var $onmousemove = ''; // The JavaScript action to perform when the user's mouse moves over the map container + var $onmouseout = ''; // The JavaScript action to perform when the user's mouse exits the map container + var $onmouseover = ''; // The JavaScript action to perform when the user's mouse enters the map container + var $onresize = ''; // The JavaScript action to perform when the maps div changes size + 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 $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 + var $region = ''; // Country code top-level domain (eg "uk") within which to search. Useful if supplying addresses rather than lat/longs var $scaleControlPosition = ''; // The position of the Scale control, eg. 'BOTTOM_RIGHT' - var $scrollwheel = TRUE; // If set to FALSE will disable zooming by scrolling of the mouse wheel - var $sensor = FALSE; // Set to TRUE if being used on a device that can detect a users location - var $streetViewAddressControl = TRUE; // If set to FALSE will hide the Address control - var $streetViewAddressPosition = ''; // The position of the Address control, eg. 'BOTTOM' - var $streetViewControlPosition = ''; // The position of the Street View control when viewing normal aerial map, eg. 'BOTTOM_RIGHT' + var $scrollwheel = TRUE; // If set to FALSE will disable zooming by scrolling of the mouse wheel + var $sensor = FALSE; // Set to TRUE if being used on a device that can detect a users location + var $streetViewAddressControl = TRUE; // If set to FALSE will hide the Address control + var $streetViewAddressPosition = ''; // The position of the Address control, eg. 'BOTTOM' + var $streetViewControlPosition = ''; // The position of the Street View control when viewing normal aerial map, eg. 'BOTTOM_RIGHT' var $streetViewCloseButton = FALSE; // If set to TRUE will show the close button in the top right. The close button allows users to return to the aerial map var $streetViewLinksControl = TRUE; // If set to FALSE will hide the Links control var $streetViewPanControl = TRUE; // If set to FALSE will hide the Pan control @@ -95,50 +95,46 @@ class Googlemaps { var $streetViewZoomControl = TRUE; // If set to FALSE will hide the Zoom control var $streetViewZoomPosition = ''; // The position of the Scale control, eg. 'TOP_RIGHT' var $streetViewZoomStyle = ''; // The size of the Street View zoom control. blank, 'SMALL' or 'LARGE' values accepted. - var $styles = array(); // An array of styles used to colour aspects of the map and turn points of interest on and off + var $styles = array(); // An array of styles used to colour aspects of the map and turn points of interest on and off var $stylesAsMapTypes = false; // If applying styles, whether to apply them to the default map or add them as additional map types - var $stylesAsMapTypesDefault = ''; // If $stylesAsMapTypes is true the default style. Should contain the 'Name' of the style - var $tilt = 0; // The angle of tilt. Currently only supports the values 0 and 45 in SATELLITE and HYBRID map types and at certain zoom levels - var $trafficOverlay = FALSE; // If set to TRUE will overlay traffic information onto the map by default - var $version = "3"; // Version of the API being used. Not currently used in the library - var $zoom = 13; // The default zoom level of the map. If set to "auto" will autozoom/center to fit in all visible markers. If "auto", also overrides the $center parameter + var $stylesAsMapTypesDefault = ''; // If $stylesAsMapTypes is true the default style. Should contain the 'Name' of the style + var $tilt = 0; // The angle of tilt. Currently only supports the values 0 and 45 in SATELLITE and HYBRID map types and at certain zoom levels + var $trafficOverlay = FALSE; // If set to TRUE will overlay traffic information onto the map by default + var $version = "3"; // Version of the API being used. Not currently used in the library + var $zoom = 13; // The default zoom level of the map. If set to "auto" will autozoom/center to fit in all visible markers. If "auto", also overrides the $center parameter var $zoomControlPosition = ''; // The position of the Zoom control, eg. 'BOTTOM_RIGHT' var $zoomControlStyle = ''; // The size of the zoom control. blank, 'SMALL' or 'LARGE' values accepted. - - var $markers = array(); // An array used by the library to store the markers as they are produced - var $markersInfo = array(); // An array containing marker information (id, latitude, longitude etc) for use elsewhere - var $polylines = array(); // An array used by the library to store the polylines as they are produced - var $polygons = array(); // An array used by the library to store the polygons as they are produced - var $circles = array(); // An array used by the library to store the circles as they are produced - var $rectangles = array(); // An array used by the library to store the rectangles as they are produced - var $overlays = array(); // An array used by the library to store the overlays as they are produced - - var $directions = FALSE; // Whether or not the map will be used to show directions + var $markers = array(); // An array used by the library to store the markers as they are produced + var $makersInfo = array(); // An array containing marker information (id, latitude, longitude etc) for use elsewhere + var $polylines = array(); // An array used by the library to store the polylines as they are produced + var $polygons = array(); // An array used by the library to store the polygons as they are produced + var $circles = array(); // An array used by the library to store the circles as they are produced + var $rectangles = array(); // An array used by the library to store the rectangles as they are produced + var $overlays = array(); // An array used by the library to store the overlays as they are produced + var $directions = FALSE; // Whether or not the map will be used to show directions var $directionsStart = ""; // The starting location (lat/long co-ordinate or address) of the directions - var $directionsEnd = ""; // The destination point (lat/long co-ordinate or address) of the directions + var $directionsEnd = ""; // The destination point (lat/long co-ordinate or address) of the directions var $directionsDivID = ""; // An element's ID on the page where textual directions will be output to. Leave blank if not required - var $directionsMode = "DRIVING"; // DRIVING, WALKING or BICYCLING (US Only) - The vehicle/mode of transport to show directions for + var $directionsMode = "DRIVING"; // DRIVING, WALKING or BICYCLING (US Only) - The vehicle/mode of transport to show directions for var $directionsAvoidTolls = FALSE; // Whether or not directions should avoid tolls - var $directionsAvoidHighways = FALSE; // Whether or not directions should avoid highways + var $directionsAvoidHighways = FALSE; // Whether or not directions should avoid highways var $directionsDraggable = FALSE; // Whether or not directions on the map are draggable var $directionsChanged = ""; // JavaScript to perform when directions are dragged var $directionsUnits = ""; // 'metric' for kilometers and meters or 'imperial for miles and feet. Leave blank and it will default to the region or country of where directions are being obtained - - var $drawing = FALSE; // Whether or not the drawing library tools will be loaded - var $drawingControl = TRUE; // If set to FALSE will hide the Drawing Manager control - var $drawingControlPosition = 'TOP_CENTER'; // The position of the Drawing Manager control, eg. 'TOP_RIGHT' + var $drawing = FALSE; // Whether or not the drawing library tools will be loaded + var $drawingControl = TRUE; // If set to FALSE will hide the Drawing Manager control + var $drawingControlPosition = 'TOP_CENTER'; // The position of the Drawing Manager control, eg. 'TOP_RIGHT' var $drawingDefaultMode = 'marker'; // The default mode for the Drawing Manager. Accepted values are marker, polygon, polyline, rectangle, circle, or null. null means that the user can interact with the map as normal when the map loads, and clicks do not draw anything. - var $drawingModes = array(); // An array of modes available for use. Accepted values are marker, polygon, polyline, rectangle, circle + var $drawingModes = array(); // An array of modes available for use. Accepted values are marker, polygon, polyline, rectangle, circle var $drawingOnComplete = array(); // An array of JS to execute when shapes are completed, one array element per shape. For example: array('circle'=>'JS here', 'polygon'=>'JS here'); - var $drawingOnEdit = array(); // An array of JS to execute when shapes are changed/resized, one array element per shape. For example: array('circle'=>'JS here', 'polygon'=>'JS here'); - - var $places = FALSE; // Whether or not the map will be used to show places - var $placesLocation = ''; // A point (lat/long co-ordinate or address) on the map if the search for places is based around a central point - var $placesRadius = 0; // The radius (in meters) if search is based around a central position + var $drawingOnEdit = array(); // An array of JS to execute when shapes are changed/resized, one array element per shape. For example: array('circle'=>'JS here', 'polygon'=>'JS here'); + var $places = FALSE; // Whether or not the map will be used to show places + var $placesLocation = ''; // A point (lat/long co-ordinate or address) on the map if the search for places is based around a central point + var $placesRadius = 0; // The radius (in meters) if search is based around a central position var $placesLocationSW = ''; // If preferring to search within bounds the South-West position (latitude/longitude coordinate OR address) var $placesLocationNE = ''; // If preferring to search within bounds the North-East position (latitude/longitude coordinate OR address) - var $placesTypes = array(); // The types of places to search for. For a list of supported types see http://code.google.com/apis/maps/documentation/places/supported_types.html - var $placesName = ''; // A term to be matched against when searching for places to display on the map + var $placesTypes = array(); // The types of places to search for. For a list of supported types see http://code.google.com/apis/maps/documentation/places/supported_types.html + var $placesName = ''; // A term to be matched against when searching for places to display on the map function Googlemaps($config = array()) { @@ -160,7 +156,12 @@ function initialize($config = array()) } } - if ($this->sensor) { $this->sensor = "true"; }else{ $this->sensor = "false"; } + if ($this->sensor) { + $this->sensor = "true"; + } + else{ + $this->sensor = "false"; + } } @@ -171,27 +172,27 @@ function add_marker($params = array()) $this->markersInfo['marker_'.count($this->markers)] = array(); $marker['position'] = ''; // The position (lat/long co-ordinate or address) at which the marker will appear - $marker['infowindow_content'] = ''; // If not blank, creates an infowindow (aka bubble) with the content provided. Can be plain text or HTML - $marker['id'] = ''; // The unique identifier of the marker suffix (ie. marker_yourID). If blank, this will default to marker_X where X is an incremental number - $marker['clickable'] = TRUE; // Defines if the marker is clickable + $marker['infowindow_content'] = ''; // If not blank, creates an infowindow (aka bubble) with the content provided. Can be plain text or HTML + $marker['id'] = ''; // The unique identifier of the marker suffix (ie. marker_yourID). If blank, this will default to marker_X where X is an incremental number + $marker['clickable'] = TRUE; // Defines if the marker is clickable $marker['cursor'] = ''; // The name or url of the cursor to display on hover - $marker['draggable'] = FALSE; // Defines if the marker is draggable + $marker['draggable'] = FALSE; // Defines if the marker is draggable $marker['flat'] = FALSE; // If set to TRUE will not display a shadow beneath the icon $marker['icon'] = ''; // The name or url of the icon to use for the marker $marker['animation'] = ''; // blank, 'DROP' or 'BOUNCE' $marker['onclick'] = ''; // JavaScript performed when a marker is clicked $marker['ondblclick'] = ''; // JavaScript performed when a marker is double-clicked $marker['ondrag'] = ''; // JavaScript repeatedly performed while the marker is being dragged - $marker['ondragstart'] = ''; // JavaScript performed when a marker is started to be dragged + $marker['ondragstart'] = ''; // JavaScript performed when a marker is started to be dragged $marker['ondragend'] = ''; // JavaScript performed when a draggable marker is dropped - $marker['onmousedown'] = ''; // JavaScript performed when a mousedown event occurs on a marker + $marker['onmousedown'] = ''; // JavaScript performed when a mousedown event occurs on a marker $marker['onmouseout'] = ''; // JavaScript performed when the mouse leaves the area of the marker icon - $marker['onmouseover'] = ''; // JavaScript performed when the mouse enters the area of the marker icon + $marker['onmouseover'] = ''; // JavaScript performed when the mouse enters the area of the marker icon $marker['onmouseup'] = ''; // JavaScript performed when a mouseup event occurs on a marker - $marker['onpositionchanged'] = ''; // JavaScript performed when the markers position changes - $marker['onrightclick'] = ''; // JavaScript performed when a right-click occurs on a marker - $marker['raiseondrag'] = TRUE; // If FALSE, disables the raising and lowering of the icon when a marker is being dragged - $marker['shadow'] = ''; // The name or url of the icon’s shadow + $marker['onpositionchanged'] = ''; // JavaScript performed when the markers position changes + $marker['onrightclick'] = ''; // JavaScript performed when a right-click occurs on a marker + $marker['raiseondrag'] = TRUE; // If FALSE, disables the raising and lowering of the icon when a marker is being dragged + $marker['shadow'] = ''; // The name or url of the icon�s shadow $marker['title'] = ''; // The tooltip text to show on hover $marker['visible'] = TRUE; // Defines if the marker is visible by default $marker['zIndex'] = ''; // The zIndex of the marker. If two markers overlap, the marker with the higher zIndex will appear on top @@ -199,13 +200,9 @@ function add_marker($params = array()) $marker_output = ''; foreach ($params as $key => $value) { - if (isset($marker[$key])) { - $marker[$key] = $value; - } - } $marker_id = count($this->markers); @@ -401,10 +398,10 @@ function add_polyline($params = array()) $polyline['points'] = array(); // An array of latitude/longitude coordinates OR addresses, or a mixture of both. If an address is supplied the Google geocoding service will be used to return a lat/long. $polyline['clickable'] = TRUE; // Defines if the polyline is clickable - $polyline['strokeColor'] = '#FF0000'; // The hex value of the polylines color + $polyline['strokeColor'] = '#FF0000'; // The hex value of the polylines color $polyline['strokeOpacity'] = '1.0'; // The opacity of the polyline. 0 to 1.0 $polyline['strokeWeight'] = '2'; // The thickness of the polyline - $polyline['onclick'] = ''; // JavaScript performed when a polyline is clicked + $polyline['onclick'] = ''; // JavaScript performed when a polyline is clicked $polyline['ondblclick'] = ''; // JavaScript performed when a polyline is double-clicked $polyline['onmousedown'] = ''; // JavaScript performed when a mousedown event occurs on a polyline $polyline['onmousemove'] = ''; // JavaScript performed when the mouse moves in the area of the polyline @@ -412,22 +409,17 @@ function add_polyline($params = array()) $polyline['onmouseover'] = ''; // JavaScript performed when the mouse enters the area of the polyline $polyline['onmouseup'] = ''; // JavaScript performed when a mouseup event occurs on a polyline $polyline['onrightclick'] = ''; // JavaScript performed when a right-click occurs on a polyline - $polyline['zIndex'] = ''; // The zIndex of the polyline. If two polylines overlap, the polyline with the higher zIndex will appear on top + $polyline['zIndex'] = ''; // The zIndex of the polyline. If two polylines overlap, the polyline with the higher zIndex will appear on top $polyline_output = ''; foreach ($params as $key => $value) { - if (isset($polyline[$key])) { - $polyline[$key] = $value; - } - } if (count($polyline['points'])) { - $polyline_output .= ' var polyline_plan_'.count($this->polylines).' = ['; $i=0; @@ -440,7 +432,7 @@ function add_polyline($params = array()) $polyline_output .= ' new google.maps.LatLng('.$point.') '; - }else{ + } else{ $lat_long = $this->get_lat_long_from_address($point); $polyline_output .= ' new google.maps.LatLng('.$lat_long[0].', '.$lat_long[1].')'; @@ -534,32 +526,29 @@ function add_polyline($params = array()) } array_push($this->polylines, $polyline_output); - } - } function add_polygon($params = array()) { - $polygon = array(); $polygon['points'] = array(); // The positions (latitude/longitude coordinates OR addresses) at which the polygon points will appear. NOTE: The first and last elements of the array must be the same $polygon['clickable'] = TRUE; // Defines if the polygon is clickable - $polygon['strokeColor'] = '#FF0000'; // The hex value of the polygons border color + $polygon['strokeColor'] = '#FF0000'; // The hex value of the polygons border color $polygon['strokeOpacity'] = '0.8'; // The opacity of the polygon border. 0 to 1.0 $polygon['strokeWeight'] = '2'; // The thickness of the polygon border $polygon['fillColor'] = '#FF0000'; // The hex value of the polygons fill color $polygon['fillOpacity'] = '0.3'; // The opacity of the polygons fill - $polygon['onclick'] = ''; // JavaScript performed when a polygon is clicked + $polygon['onclick'] = ''; // JavaScript performed when a polygon is clicked $polygon['ondblclick'] = ''; // JavaScript performed when a polygon is double-clicked $polygon['onmousedown'] = ''; // JavaScript performed when a mousedown event occurs on a polygon $polygon['onmousemove'] = ''; // JavaScript performed when the mouse moves in the area of the polygon $polygon['onmouseout'] = ''; // JavaScript performed when the mouse leaves the area of the polygon $polygon['onmouseover'] = ''; // JavaScript performed when the mouse enters the area of the polygon - $polygon['onmouseup'] = ''; // JavaScript performed when a mouseup event occurs on a polygon + $polygon['onmouseup'] = ''; // JavaScript performed when a mouseup event occurs on a polygon $polygon['onrightclick'] = ''; // JavaScript performed when a right-click occurs on a polygon - $polygon['zIndex'] = ''; // The zIndex of the polygon. If two polygons overlap, the polygon with the higher zIndex will appear on top + $polygon['zIndex'] = ''; // The zIndex of the polygon. If two polygons overlap, the polygon with the higher zIndex will appear on top $polygon_output = ''; @@ -601,9 +590,7 @@ function add_polygon($params = array()) $polygon_output .= '];'; $polygon_output .= $lat_long_output; - } - $polygon_output .= ' var polygon_'.count($this->polygons).' = new google.maps.Polygon({ '; @@ -687,49 +674,41 @@ function add_polygon($params = array()) '.$polygon['onrightclick'].' }); '; - } - + } array_push($this->polygons, $polygon_output); - } function add_circle($params = array()) { - $circle = array(); - $circle['center'] = ''; // The center position (latitude/longitude coordinate OR addresse) at which the circle will appear + $circle['center'] = ''; // The center position (latitude/longitude coordinate OR addresse) at which the circle will appear $circle['clickable'] = TRUE; // Defines if the circle is clickable - $circle['radius'] = 0; // The circle radius (in metres) + $circle['radius'] = 0; // The circle radius (in metres) $circle['strokeColor'] = '0.8'; // The hex value of the circles border color $circle['strokeOpacity'] = '0.8'; // The opacity of the circle border $circle['strokeWeight'] = '2'; // The thickness of the circle border $circle['fillColor'] = '#FF0000'; // The hex value of the circles fill color $circle['fillOpacity'] = '0.3'; // The opacity of the circles fill - $circle['onclick'] = ''; // JavaScript performed when a circle is clicked - $circle['ondblclick'] = ''; // JavaScript performed when a circle is double-clicked + $circle['onclick'] = ''; // JavaScript performed when a circle is clicked + $circle['ondblclick'] = ''; // JavaScript performed when a circle is double-clicked $circle['onmousedown'] = ''; // JavaScript performed when a mousedown event occurs on a circle $circle['onmousemove'] = ''; // JavaScript performed when the mouse moves in the area of the circle - $circle['onmouseout'] = ''; // JavaScript performed when the mouse leaves the area of the circle + $circle['onmouseout'] = ''; // JavaScript performed when the mouse leaves the area of the circle $circle['onmouseover'] = ''; // JavaScript performed when the mouse enters the area of the circle - $circle['onmouseup'] = ''; // JavaScript performed when a mouseup event occurs on a circle + $circle['onmouseup'] = ''; // JavaScript performed when a mouseup event occurs on a circle $circle['onrightclick'] = ''; // JavaScript performed when a right-click occurs on a circle - $circle['zIndex'] = ''; // The zIndex of the circle. If two circles overlap, the circle with the higher zIndex will appear on top + $circle['zIndex'] = ''; // The zIndex of the circle. If two circles overlap, the circle with the higher zIndex will appear on top $circle_output = ''; foreach ($params as $key => $value) { - if (isset($circle[$key])) { - $circle[$key] = $value; - } - } if ($circle['radius']>0 && $circle['center']!="") { - $lat_long_to_push = ''; if ($this->is_lat_long($circle['center'])) { $lat_long_to_push = $circle['center']; @@ -825,27 +804,23 @@ function add_circle($params = array()) }); '; } - - array_push($this->circles, $circle_output); - + array_push($this->circles, $circle_output); } - } function add_rectangle($params = array()) { - $rectangle = array(); $rectangle['positionSW'] = ''; // The South-West position (latitude/longitude coordinate OR address) at which the rectangle will appear $rectangle['positionNE'] = ''; // The North-East position(latitude/longitude coordinate OR address) at which the rectangle will appear $rectangle['clickable'] = TRUE; // Defines if the rectangle is clickable $rectangle['strokeColor'] = '0.8'; // The hex value of the rectangles border color - $rectangle['strokeOpacity'] = '0.8'; // The opacity of the rectangle border + $rectangle['strokeOpacity'] = '0.8'; // The opacity of the rectangle border $rectangle['strokeWeight'] = '2'; // The thickness of the rectangle border - $rectangle['fillColor'] = '#FF0000'; // The hex value of the rectangles fill color + $rectangle['fillColor'] = '#FF0000'; // The hex value of the rectangles fill color $rectangle['fillOpacity'] = '0.3'; // The opacity of the rectangles fill - $rectangle['onclick'] = ''; // JavaScript performed when a rectangle is clicked + $rectangle['onclick'] = ''; // JavaScript performed when a rectangle is clicked $rectangle['ondblclick'] = ''; // JavaScript performed when a rectangle is double-clicked $rectangle['onmousedown'] = ''; // JavaScript performed when a mousedown event occurs on a rectangle $rectangle['onmousemove'] = ''; // JavaScript performed when the mouse moves in the area of the rectangle @@ -853,18 +828,14 @@ function add_rectangle($params = array()) $rectangle['onmouseover'] = ''; // JavaScript performed when the mouse enters the area of the rectangle $rectangle['onmouseup'] = ''; // JavaScript performed when a mouseup event occurs on a rectangle $rectangle['onrightclick'] = ''; // JavaScript performed when a right-click occurs on a rectangle - $rectangle['zIndex'] = ''; // The zIndex of the rectangle. If two rectangles overlap, the rectangle with the higher zIndex will appear on top + $rectangle['zIndex'] = ''; // The zIndex of the rectangle. If two rectangles overlap, the rectangle with the higher zIndex will appear on top $rectangle_output = ''; foreach ($params as $key => $value) { - if (isset($rectangle[$key])) { - - $rectangle[$key] = $value; - + $rectangle[$key] = $value; } - } if ($rectangle['positionSW']!="" && $rectangle['positionNE']!="") { @@ -981,11 +952,8 @@ function add_rectangle($params = array()) }); '; } - array_push($this->rectangles, $rectangle_output); - } - } function add_ground_overlay($params = array()) @@ -994,21 +962,17 @@ function add_ground_overlay($params = array()) $overlay = array(); $overlay['image'] = ''; // JavaScript performed when a ground overlay is clicked - $overlay['positionSW'] = ''; // The South-West position (latitude/longitude coordinate OR addresse) at which the ground overlay will appear - $overlay['positionNE'] = ''; // The North-East position (latitude/longitude coordinate OR addresse) at which the ground overlay will appear - $overlay['clickable'] = TRUE; // Defines if the ground overlay is clickable + $overlay['positionSW'] = ''; // The South-West position (latitude/longitude coordinate OR addresse) at which the ground overlay will appear + $overlay['positionNE'] = ''; // The North-East position (latitude/longitude coordinate OR addresse) at which the ground overlay will appear + $overlay['clickable'] = TRUE; // Defines if the ground overlay is clickable $overlay['onclick'] = ''; // JavaScript performed when a ground overlay is clicked $overlay_output = ''; foreach ($params as $key => $value) { - if (isset($overlay[$key])) { - $overlay[$key] = $value; - } - } if ($overlay['image']!="" && $overlay['positionSW']!="" && $overlay['positionNE']!="") { @@ -1058,11 +1022,8 @@ function add_ground_overlay($params = array()) }); '; } - array_push($this->overlays, $overlay_output); - } - } function create_map() @@ -1535,10 +1496,8 @@ function create_map() }'; } } - $this->output_js_contents .= ' });'; - } if ($this->places) { @@ -2053,14 +2012,9 @@ function get_lat_long_from_address($address) "longitude"=>$lng ); $CI->db->insert("geocoding", $data); - } - + } } - - return array($lat, $lng); - - } - + return array($lat, $lng); + } } - -?> \ No newline at end of file +?>