This commit is contained in:
bastianonm 2012-03-18 10:44:11 +00:00
parent adae9f570f
commit ae23baea30
3 changed files with 38 additions and 34 deletions

View File

@ -52,50 +52,53 @@ function unqueue()
CustomMarker.prototype.draw = function() { CustomMarker.prototype.draw = function() {
var me = this; var me = this;
// Check if the div has been created. // Check if the el has been created.
var div = this.div_; var el = this.img_;
if (!div) { if (!el) {
// Create a overlay text DIV
div = this.div_ = document.createElement('DIV'); el = this.img_ = document.createElement('img');
div.style.cssText = "border:1px solid #fff;position:absolute;cursor:pointer;margin:0;background:url('"+this.src_+"') center;width:"+(this.img_w_/3)+"px;height:"+(this.img_h_/3)+"px;"; el.style.cssText = "border:1px solid #fff;position:absolute;cursor:pointer;margin:0;width:"+(this.img_w_/3)+"px;height:"+(this.img_h_/3)+"px;z-index:1;";
div.setAttribute("lat",this.latlng_.lat()); el.setAttribute("lat",this.latlng_.lat());
div.setAttribute("lon",this.latlng_.lng()); el.setAttribute("lon",this.latlng_.lng());
google.maps.event.addDomListener(div, "click", function(event) { el.src=this.src_;
google.maps.event.trigger(me, "click",div);
google.maps.event.addDomListener(el, "click", function(event) {
google.maps.event.trigger(me, "click",el);
}); });
google.maps.event.addDomListener(div, "mouseover", function(event) { google.maps.event.addDomListener(el, "mouseover", function(event) {
var _t = el.style.top.replace('px','');
var _t = div.style.top.replace('px',''); var _l = el.style.left.replace('px','');
var _l = div.style.left.replace('px',''); jQuery(el).animate({
jQuery(div).animate({
height: me.img_h_, height: me.img_h_,
width : me.img_w_, width : me.img_w_,
top : _t - (me.img_h_ / 3), top : _t - (me.img_h_ / 3),
left : _l - (me.img_w_ / 3) left : _l - (me.img_w_ / 3),
'z-index' : 9999
}, 100); }, 100);
}); });
google.maps.event.addDomListener(div, "mouseout", function(event) { google.maps.event.addDomListener(el, "mouseout", function(event) {
jQuery(div).animate({ jQuery(el).animate({
height: me.img_h_ / 3, height: me.img_h_ / 3,
width: me.img_w_ / 3, width: me.img_w_ / 3,
top : me.orig_top, top : me.orig_top,
left : me.orig_left left : me.orig_left,
'z-index' : 1
}, 100); }, 100);
}); });
// Then add the overlay to the DOM // Then add the overlay to the DOM
var panes = this.getPanes(); var panes = this.getPanes();
panes.overlayImage.appendChild(div); panes.overlayImage.appendChild(el);
} }
// Position the overlay // Position the overlay
var point = this.getProjection().fromLatLngToDivPixel(this.latlng_); var point = this.getProjection().fromLatLngToDivPixel(this.latlng_);
if (point) { if (point) {
div.style.left = point.x + 'px'; el.style.left = point.x + 'px';
div.style.top = point.y + 'px'; el.style.top = point.y + 'px';
this.orig_left = point.x; this.orig_left = point.x;
this.orig_top = point.y; this.orig_top = point.y;
@ -105,9 +108,9 @@ function unqueue()
CustomMarker.prototype.remove = function() { CustomMarker.prototype.remove = function() {
// Check if the overlay was on the map and needs to be removed. // Check if the overlay was on the map and needs to be removed.
if (this.div_) { if (this.img_) {
this.div_.parentNode.removeChild(this.div_); this.img_.parentNode.removeChild(this.img_);
this.div_ = null; this.img_ = null;
} }
}; };
@ -183,7 +186,7 @@ function _wpgpxmaps(params)
divImages.style.display='block'; divImages.style.display='block';
divImages.style.position='absolute'; divImages.style.position='absolute';
divImages.style.left='-500px'; divImages.style.left='-50000px';
var img_spans = divImages.getElementsByTagName("span"); var img_spans = divImages.getElementsByTagName("span");

View File

@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
Tags: maps, gpx, gps, graph, chart, google maps, google chart, track, garmin, image, nextgen-gallery, nextgen, exif Tags: maps, gpx, gps, graph, chart, google maps, google chart, track, garmin, image, nextgen-gallery, nextgen, exif
Requires at least: 2.0.0 Requires at least: 2.0.0
Tested up to: 3.3 Tested up to: 3.3
Stable tag: 1.1.11 Stable tag: 1.1.12
License: GPLv2 or later License: GPLv2 or later
Draws a gpx track with altitude graph Draws a gpx track with altitude graph
@ -109,6 +109,8 @@ Yes!
2. Admin area - Settings 2. Admin area - Settings
== Changelog == == Changelog ==
= 1.1.12 =
* nextgen gallery display bug fixes
= 1.1.11 = = 1.1.11 =
* nextgen gallery integration * nextgen gallery integration
* minor bug fixes * minor bug fixes
@ -171,6 +173,7 @@ Yes!
* Initial release * Initial release
== Upgrade Notice == == Upgrade Notice ==
= 1.1.12 =
= 1.1.11 = = 1.1.11 =
= 1.1.10 = = 1.1.10 =
= 1.1.9 = = 1.1.9 =

View File

@ -3,7 +3,7 @@
Plugin Name: WP-GPX-Maps Plugin Name: WP-GPX-Maps
Plugin URI: http://www.darwinner.it/ Plugin URI: http://www.darwinner.it/
Description: Draws a gpx track with altitude graph Description: Draws a gpx track with altitude graph
Version: 1.1.11 Version: 1.1.12
Author: Bastianon Massimo Author: Bastianon Massimo
Author URI: http://www.pedemontanadelgrappa.it/ Author URI: http://www.pedemontanadelgrappa.it/
License: GPL License: GPL
@ -46,7 +46,7 @@ function enqueue_WP_GPX_Maps_scripts()
google.load('visualization', '1', {'packages':['corechart']}); google.load('visualization', '1', {'packages':['corechart']});
google.load("maps", "3", {other_params: 'sensor=false'}); google.load("maps", "3", {other_params: 'sensor=false'});
</script> </script>
<script type='text/javascript' src='<?php echo plugins_url('/WP-GPX-Maps.js', __FILE__) ?>?ver=1.1.11'></script> <script type='text/javascript' src='<?php echo plugins_url('/WP-GPX-Maps.js', __FILE__) ?>?ver=1.1.12'></script>
<?php <?php
} }
@ -97,9 +97,7 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='')
$r = rand(1,5000000); $r = rand(1,5000000);
$cacheFileName = "$gpx,$w,$mh,$mt,$gh,$showW,$donotreducegpx,$pointsoffset,$showSpeed,$uom,$ngGallery"; $cacheFileName = md5(serialize($attr));
$cacheFileName = md5($cacheFileName);
$gpxcache = gpxCacheFolderPath(); $gpxcache = gpxCacheFolderPath();