From f0c079c8db4ec81e36cf766cac942b5508342b72 Mon Sep 17 00:00:00 2001 From: Greg Roach Date: Wed, 15 Jun 2016 19:46:26 +0100 Subject: GM cleanup --- app/Module/GoogleMapsModule.php | 27 +++++++++++++------------ modules_v3/googlemap/css/wt_v3_googlemap.css | 30 +++++++--------------------- 2 files changed, 21 insertions(+), 36 deletions(-) diff --git a/app/Module/GoogleMapsModule.php b/app/Module/GoogleMapsModule.php index bb2ef93d5e..a30df1c672 100644 --- a/app/Module/GoogleMapsModule.php +++ b/app/Module/GoogleMapsModule.php @@ -1173,12 +1173,11 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, new google.maps.Size(24, 24), // Image size new google.maps.Point(0, 0), // Image origin new google.maps.Point(2, 22) // Image anchor - );' . + ); // / A function to create the marker and set up the event window - 'function createMarker(point, name, html, mhtml, icontype) { - var contentString = "
" + mhtml + "
";' . + function createMarker(point, name, html, mhtml, icontype) { // Create a marker with the requested icon - 'var marker = new google.maps.Marker({ + var marker = new google.maps.Marker({ icon: gicons[icontype], shadow: gicons[icontype].shadow, map: pm_map, @@ -1188,7 +1187,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, }); google.maps.event.addListener(marker, "click", function() { infowindow.close(); - infowindow.setContent(contentString); + infowindow.setContent(mhtml); infowindow.open(pm_map, marker); var el = jQuery("#link_" + marker.id); if(el.hasClass("person_box")) { @@ -1314,7 +1313,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, $js .= 'var point = new google.maps.LatLng(' . $lat[$i] . ',' . $lon[$i] . ');'; $js .= 'var marker = createMarker(point, "' . Filter::escapeJs($name) . '","' . $dataleft . '
' . $datamid . $dataright . '
", "'; - $js .= '
'; + $js .= '
'; $js .= 'getTree()->getNameUrl() . '&mod=googlemap&mod_action=pedigree_map&rootid=' . $person->getXref() . '&PEDIGREE_GENERATIONS=' . $PEDIGREE_GENERATIONS; $js .= '\" title=\"' . I18N::translate('Pedigree map') . '\">' . $dataleft . '' . $datamid . $dataright . '
", "' . $marker_number . '");'; // Construct the polygon lines @@ -2523,7 +2522,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, echo 'icon_type.iconSize = google.maps.Size(20, 34);'; echo 'icon_type.shadowSize = google.maps.Size(37, 34);'; echo 'var point = new google.maps.LatLng(0, 0);'; - echo 'var marker = createMarker(point, "

'; } else { @@ -2568,7 +2567,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, echo ' icon_type.shadowSize = new google.maps.Size(35, 45);'; } echo 'var point = new google.maps.LatLng(', $lati, ', ', $long, ');'; - echo 'var marker = createMarker(point, "
'; + var name = + '
' + response[i].address_components[0].short_name + + '
' + + '' + + '
'; var point = response[i].geometry.location; var marker = createMarker(i, point, name); bounds.extend(response[i].geometry.location); diff --git a/modules_v3/googlemap/css/wt_v3_googlemap.css b/modules_v3/googlemap/css/wt_v3_googlemap.css index 09c9105fd0..c8d81f3358 100644 --- a/modules_v3/googlemap/css/wt_v3_googlemap.css +++ b/modules_v3/googlemap/css/wt_v3_googlemap.css @@ -21,6 +21,12 @@ margin: 20px; } +/* Google adds "android" styling to info-windows - reset this */ +.gm-style, +.gm-style .gm-style-iw { + font: inherit; +} + /* Contains a map and a list of events */ .gm-wrapper { border: 1px solid #888; @@ -44,6 +50,7 @@ /* Pop-up window in a map */ .gm-info-window { font-size: 12px; + min-height: 60px; max-height: 240px; overflow-x: hidden; } @@ -59,8 +66,6 @@ .gm-info-window-content-edit { background-color: #eee; border: 1px solid #bbb; - height: 60px; - margin-right: 0; } .gm-info-window-content-edit a { @@ -139,31 +144,10 @@ width: 360px; } -/* places_edit */ -#gname { - vertical-align: middle; - height: 60px; - margin-top: 0; - white-space: pre-wrap; - width: 200px; -} - -#namelink { - padding-bottom: 5px; -} - .list_table { width: 500px; } -.optionbox #gname { - white-space: normal; -} - -.iwstyle { - width: 360px; -} - .link { min-height: 50px; margin: 5px; -- cgit v1.3