Needed the marker draggable and therefore updated map.js with the following lines.
var draggable = false;
if (typeof(mapObject.markers.draggable) != 'undefined')
draggable = mapObject.markers.draggable;
.
.
.
// set marker draggable property
marker.setDraggable(draggable);
Usage:
'markers' => array(
'draggable' => true,
Hope this helps someone working with this new cook feature.
Warm regards
vlemos
<?php echo JDom::_('html.fly.map.google', array(
'keyAPI' => '<YOUR API KEY>',
'request' => array(
'zoom' => 4,
),
'markers' => array(
'fitBounds' => true,
'draggable' => true,
'data' => array(
array(
// Australia
'position' => array(
'lat' => -25.363,
'lng' => 131.044
),
'title' => 'Australia'
),
)
),
)); ?>
IN: .../libraries/jdom/assets/google/js/map.js
// Instance the markers
if ((typeof(mapObject.markers) != 'undefined') && (typeof(mapObject.markers.data) != 'undefined'))
{
var fitBounds = false;
if (typeof(mapObject.markers.fitBounds) != 'undefined')
fitBounds = mapObject.markers.fitBounds;
if (fitBounds)
{
map._ck.bounds = new google.maps.LatLngBounds();
map._ck.bounds = null;
}
var draggable = false;
if (typeof(mapObject.markers.draggable) != 'undefined')
draggable = mapObject.markers.draggable;
// Global Icon sizes
var iconSizeWidth = 20;
if (typeof(mapObject.markers.iconWidth) != 'undefined')
iconSizeWidth = mapObject.markers.iconWidth;
var iconSizeHeight = 32;
if (typeof(mapObject.markers.iconHeight) != 'undefined')
iconSizeHeight = mapObject.markers.iconHeight;
// Global Animations
var animation = null;
if (typeof(mapObject.markers.animation) != 'undefined')
animation = google.maps.Animation['mapObject.markers.animation'];
var markers = mapObject.markers.data;
mapObject.markers.googleObject = [];
var googleMarkers = mapObject.markers.googleObject;
for (var i = 0 ; i < markers.length ; i++)
{
var markerData = markers[i];
// Index the markers by id
var idMarker = i;
// Set the amimation
if (animation)
markerData.animation = animation;
//Set the map to the data
markerData.map = map;
if (typeof(markerData.icon) != 'undefined')
{
// Get special sizes for every single marker
var iconWidth = iconSizeWidth;
if (typeof(markerData.iconWidth) != 'undefined')
iconWidth = markerData.iconWidth;
var iconHeight = iconSizeHeight;
if (typeof(markerData.iconHeight) != 'undefined')
iconHeight = markerData.iconHeight;
markerData.icon = new google.maps.MarkerImage(markerData.icon,
new google.maps.Size(iconWidth, iconHeight),
new google.maps.Point(0,0),
new google.maps.Point(0, 32)
);
}
// Optimization : Don't sent the content string to the marker constructor
var contentString = null;
if (typeof(markerData.content) != 'undefined')
{
contentString = markerData.content;
markerData.content = null;
}
// Create the marker
var marker = new google.maps.Marker(markerData);
// set marker draggable property
marker.setDraggable(draggable);
// Store the Google Object in order to keep it in the memory, and not be destroyed by the garbage colector.
googleMarkers[idMarker] = marker;