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() {
var me = this;
// Check if the div has been created.
var div = this.div_;
if (!div) {
// Create a overlay text DIV
div = this.div_ = document.createElement('DIV');
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;";
div.setAttribute("lat",this.latlng_.lat());
div.setAttribute("lon",this.latlng_.lng());
google.maps.event.addDomListener(div, "click", function(event) {
google.maps.event.trigger(me, "click",div);
// Check if the el has been created.
var el = this.img_;
if (!el) {
el = this.img_ = document.createElement('img');
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;";
el.setAttribute("lat",this.latlng_.lat());
el.setAttribute("lon",this.latlng_.lng());
el.src=this.src_;
google.maps.event.addDomListener(el, "click", function(event) {
google.maps.event.trigger(me, "click",el);
});
google.maps.event.addDomListener(div, "mouseover", function(event) {
var _t = div.style.top.replace('px','');
var _l = div.style.left.replace('px','');
jQuery(div).animate({
google.maps.event.addDomListener(el, "mouseover", function(event) {
var _t = el.style.top.replace('px','');
var _l = el.style.left.replace('px','');
jQuery(el).animate({
height: me.img_h_,
width : me.img_w_,
top : _t - (me.img_h_ / 3),
left : _l - (me.img_w_ / 3)
left : _l - (me.img_w_ / 3),
'z-index' : 9999
}, 100);
});
google.maps.event.addDomListener(div, "mouseout", function(event) {
jQuery(div).animate({
google.maps.event.addDomListener(el, "mouseout", function(event) {
jQuery(el).animate({
height: me.img_h_ / 3,
width: me.img_w_ / 3,
top : me.orig_top,
left : me.orig_left
left : me.orig_left,
'z-index' : 1
}, 100);
});
// Then add the overlay to the DOM
var panes = this.getPanes();
panes.overlayImage.appendChild(div);
panes.overlayImage.appendChild(el);
}
// Position the overlay
var point = this.getProjection().fromLatLngToDivPixel(this.latlng_);
if (point) {
div.style.left = point.x + 'px';
div.style.top = point.y + 'px';
el.style.left = point.x + 'px';
el.style.top = point.y + 'px';
this.orig_left = point.x;
this.orig_top = point.y;
@ -105,9 +108,9 @@ function unqueue()
CustomMarker.prototype.remove = function() {
// Check if the overlay was on the map and needs to be removed.
if (this.div_) {
this.div_.parentNode.removeChild(this.div_);
this.div_ = null;
if (this.img_) {
this.img_.parentNode.removeChild(this.img_);
this.img_ = null;
}
};
@ -183,7 +186,7 @@ function _wpgpxmaps(params)
divImages.style.display='block';
divImages.style.position='absolute';
divImages.style.left='-500px';
divImages.style.left='-50000px';
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
Requires at least: 2.0.0
Tested up to: 3.3
Stable tag: 1.1.11
Stable tag: 1.1.12
License: GPLv2 or later
Draws a gpx track with altitude graph
@ -109,6 +109,8 @@ Yes!
2. Admin area - Settings
== Changelog ==
= 1.1.12 =
* nextgen gallery display bug fixes
= 1.1.11 =
* nextgen gallery integration
* minor bug fixes
@ -171,6 +173,7 @@ Yes!
* Initial release
== Upgrade Notice ==
= 1.1.12 =
= 1.1.11 =
= 1.1.10 =
= 1.1.9 =

View File

@ -3,7 +3,7 @@
Plugin Name: WP-GPX-Maps
Plugin URI: http://www.darwinner.it/
Description: Draws a gpx track with altitude graph
Version: 1.1.11
Version: 1.1.12
Author: Bastianon Massimo
Author URI: http://www.pedemontanadelgrappa.it/
License: GPL
@ -46,7 +46,7 @@ function enqueue_WP_GPX_Maps_scripts()
google.load('visualization', '1', {'packages':['corechart']});
google.load("maps", "3", {other_params: 'sensor=false'});
</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
}
@ -96,10 +96,8 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='')
$ngImages = findValue($attr, "ngimages", "wpgpxmaps_map_ngImages", "");
$r = rand(1,5000000);
$cacheFileName = "$gpx,$w,$mh,$mt,$gh,$showW,$donotreducegpx,$pointsoffset,$showSpeed,$uom,$ngGallery";
$cacheFileName = md5($cacheFileName);
$cacheFileName = md5(serialize($attr));
$gpxcache = gpxCacheFolderPath();