Version Notes
v 1.0.7:
fix issue of marker cluster
v 1.0.6:
update google map api to version 3
v 1.0.5:
issue in short tag
v 1.0.3:
issue in https fixed
v 1.0.2:
some issue fixed
v 1.0.0:
1) convert FIPS 10-4 region code to ISO 3166:2 region code
2) show markers map in backend
3) enable widget for google map
v 0.9:
add Net_GeoIP in to source for easy installation
v 0.8:
1) add configuration for GeoIP data file
2) check online customer from log
3) use Net_GeoIP for IP location detect
v 0.7:
add support for 'GeoIpCity.dat'
v 0.6:
change default design/template
v 0.5:
first release package
Download this release
Release Info
Developer | Magento Core Team |
Extension | Pz_WorldMap |
Version | 1.0.7 |
Comparing to | |
See all releases |
Code changes from version 1.0.6 to 1.0.7
app/code/community/Pz/WorldMap/Block/Map/Abstract.php
CHANGED
@@ -25,7 +25,7 @@
|
|
25 |
* @package Pz_WorldMap
|
26 |
*
|
27 |
* @author Cheng Wei <cheng.wei@zosoft.net>
|
28 |
-
* @version $$Id: Abstract.php
|
29 |
* @copyright Copyright (C) 2010 Z.O. Software, China (http://www.zosoft.net)
|
30 |
*/
|
31 |
|
@@ -34,7 +34,7 @@
|
|
34 |
*
|
35 |
* @package Pz_WorldMap
|
36 |
* @author Cheng Wei <cheng.wei@zosoft.net>
|
37 |
-
* @version $$Id: Abstract.php
|
38 |
*/
|
39 |
class Pz_WorldMap_Block_Map_Abstract extends Mage_Core_Block_Template implements
|
40 |
Mage_Widget_Block_Interface {
|
@@ -75,9 +75,11 @@ class Pz_WorldMap_Block_Map_Abstract extends Mage_Core_Block_Template implements
|
|
75 |
if (! self::$mapJsEnabled) {
|
76 |
$protocal = 'http';
|
77 |
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] && $_SERVER['HTTPS'] != 'off') {
|
78 |
-
|
|
|
79 |
}
|
80 |
-
$html = "<script src='$protocal://
|
|
|
81 |
echo $html;
|
82 |
|
83 |
self::$mapJsEnabled = true;
|
25 |
* @package Pz_WorldMap
|
26 |
*
|
27 |
* @author Cheng Wei <cheng.wei@zosoft.net>
|
28 |
+
* @version $$Id: Abstract.php 120 2010-12-11 14:28:53Z cwei $$
|
29 |
* @copyright Copyright (C) 2010 Z.O. Software, China (http://www.zosoft.net)
|
30 |
*/
|
31 |
|
34 |
*
|
35 |
* @package Pz_WorldMap
|
36 |
* @author Cheng Wei <cheng.wei@zosoft.net>
|
37 |
+
* @version $$Id: Abstract.php 120 2010-12-11 14:28:53Z cwei $$
|
38 |
*/
|
39 |
class Pz_WorldMap_Block_Map_Abstract extends Mage_Core_Block_Template implements
|
40 |
Mage_Widget_Block_Interface {
|
75 |
if (! self::$mapJsEnabled) {
|
76 |
$protocal = 'http';
|
77 |
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] && $_SERVER['HTTPS'] != 'off') {
|
78 |
+
// TODO: enable ssl
|
79 |
+
// $protocal .= 's';
|
80 |
}
|
81 |
+
$html = "<script src='$protocal://www.google.com/jsapi'></script>";
|
82 |
+
$html .= "<script type='text/javascript'>google.load('maps', '3', {other_params: 'sensor=false'});</script>";
|
83 |
echo $html;
|
84 |
|
85 |
self::$mapJsEnabled = true;
|
app/code/community/Pz/WorldMap/etc/config.xml
CHANGED
@@ -25,7 +25,7 @@
|
|
25 |
* @package Pz_WorldMap
|
26 |
*
|
27 |
* @author Cheng Wei <cheng.wei@zosoft.net>
|
28 |
-
* @version $$Id: config.xml
|
29 |
* @copyright Copyright (C) 2010 Z.O. Software, China (http://www.zosoft.net)
|
30 |
*/
|
31 |
-->
|
25 |
* @package Pz_WorldMap
|
26 |
*
|
27 |
* @author Cheng Wei <cheng.wei@zosoft.net>
|
28 |
+
* @version $$Id: config.xml 120 2010-12-11 14:28:53Z cwei $$
|
29 |
* @copyright Copyright (C) 2010 Z.O. Software, China (http://www.zosoft.net)
|
30 |
*/
|
31 |
-->
|
app/design/adminhtml/default/default/template/worldmap/page/head.phtml
CHANGED
@@ -5,7 +5,8 @@ include($file);
|
|
5 |
|
6 |
$protocal = 'http';
|
7 |
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] && $_SERVER['HTTPS'] != 'off') {
|
8 |
-
|
|
|
9 |
}
|
10 |
?>
|
11 |
|
5 |
|
6 |
$protocal = 'http';
|
7 |
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] && $_SERVER['HTTPS'] != 'off') {
|
8 |
+
// TODO : enable ssl
|
9 |
+
// $protocal .= 's';
|
10 |
}
|
11 |
?>
|
12 |
|
js/map/markerclusterer.js
CHANGED
@@ -8,12 +8,12 @@
|
|
8 |
* @version version 1.0
|
9 |
* @author Luke Mahe
|
10 |
* @fileoverview
|
11 |
-
* The
|
12 |
* markers.
|
13 |
* <br/>
|
14 |
* This is a v3 implementation of the
|
15 |
* <a href="http://gmaps-utility-library-dev.googlecode.com/svn/tags/markerclusterer/"
|
16 |
-
* >v2
|
17 |
*/
|
18 |
|
19 |
/**
|
@@ -69,14 +69,14 @@ function MarkerClusterer(map, opt_markers, opt_options) {
|
|
69 |
|
70 |
var options = opt_options || {};
|
71 |
|
72 |
-
this.gridSize_ = options
|
73 |
-
this.maxZoom_ = options
|
74 |
-
this.styles_ = options
|
75 |
-
this.imagePath_ = options
|
76 |
this.MARKER_CLUSTER_IMAGE_PATH_;
|
77 |
-
this.imageExtension_ = options
|
78 |
this.MARKER_CLUSTER_IMAGE_EXTENSION_;
|
79 |
-
this.zoomOnClick_ = options
|
80 |
|
81 |
this.setupStyles_();
|
82 |
|
@@ -86,9 +86,10 @@ function MarkerClusterer(map, opt_markers, opt_options) {
|
|
86 |
var that = this;
|
87 |
google.maps.event.addListener(this.map_, 'zoom_changed', function() {
|
88 |
that.resetViewport();
|
|
|
89 |
});
|
90 |
|
91 |
-
google.maps.event.addListener(this.map_, '
|
92 |
that.redraw();
|
93 |
});
|
94 |
|
@@ -105,6 +106,7 @@ function MarkerClusterer(map, opt_markers, opt_options) {
|
|
105 |
* @type {string}
|
106 |
* @private
|
107 |
*/
|
|
|
108 |
MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_PATH_ =
|
109 |
'http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/' +
|
110 |
'images/m';
|
@@ -320,12 +322,11 @@ MarkerClusterer.prototype.pushMarkerTo_ = function(marker) {
|
|
320 |
marker.setVisible(false);
|
321 |
marker.setMap(null);
|
322 |
marker.isAdded = false;
|
323 |
-
if (marker
|
324 |
// If the marker is draggable add a listener so we update the clusters on
|
325 |
// the drag end.
|
326 |
var that = this;
|
327 |
google.maps.event.addListener(marker, 'dragend', function() {
|
328 |
-
marker.isAdded = false;
|
329 |
that.resetViewport();
|
330 |
that.redraw();
|
331 |
});
|
@@ -453,6 +454,7 @@ MarkerClusterer.prototype.setGridSize = function(size) {
|
|
453 |
* @return {google.maps.LatLngBounds} The extended bounds.
|
454 |
*/
|
455 |
MarkerClusterer.prototype.getExtendedBounds = function(bounds) {
|
|
|
456 |
var projection = this.getProjection();
|
457 |
|
458 |
// Turn the bounds into latlng.
|
@@ -545,20 +547,16 @@ MarkerClusterer.prototype.createClusters_ = function() {
|
|
545 |
}
|
546 |
|
547 |
// Get our current map view bounds.
|
548 |
-
|
549 |
-
var mapBounds = new google.maps.LatLngBounds(this.map_.getBounds().getSouthWest(),
|
550 |
-
this.map_.getBounds().getNorthEast());
|
551 |
-
var bounds = this.getExtendedBounds(mapBounds);
|
552 |
|
553 |
for (var i = 0, marker; marker = this.markers_[i]; i++) {
|
554 |
var added = false;
|
555 |
if (!marker.isAdded && this.isMarkerInBounds_(marker, bounds)) {
|
556 |
for (var j = 0, cluster; cluster = this.clusters_[j]; j++) {
|
557 |
-
if (
|
558 |
cluster.isMarkerInClusterBounds(marker)) {
|
559 |
added = true;
|
560 |
cluster.addMarker(marker);
|
561 |
-
break;
|
562 |
}
|
563 |
}
|
564 |
|
@@ -830,7 +828,8 @@ ClusterIcon.prototype.onAdd = function() {
|
|
830 |
* @private
|
831 |
*/
|
832 |
ClusterIcon.prototype.getPosFromLatLng_ = function(latlng) {
|
833 |
-
var
|
|
|
834 |
pos.x -= parseInt(this.width_ / 2, 10);
|
835 |
pos.y -= parseInt(this.height_ / 2, 10);
|
836 |
return pos;
|
8 |
* @version version 1.0
|
9 |
* @author Luke Mahe
|
10 |
* @fileoverview
|
11 |
+
* The libary creates and manages per-zoom-level clusters for large amounts of
|
12 |
* markers.
|
13 |
* <br/>
|
14 |
* This is a v3 implementation of the
|
15 |
* <a href="http://gmaps-utility-library-dev.googlecode.com/svn/tags/markerclusterer/"
|
16 |
+
* >v2 Markerclusterer</a>.
|
17 |
*/
|
18 |
|
19 |
/**
|
69 |
|
70 |
var options = opt_options || {};
|
71 |
|
72 |
+
this.gridSize_ = options.gridSize || 60;
|
73 |
+
this.maxZoom_ = options.maxZoom || null;
|
74 |
+
this.styles_ = options.styles || [];
|
75 |
+
this.imagePath_ = options.imagePath ||
|
76 |
this.MARKER_CLUSTER_IMAGE_PATH_;
|
77 |
+
this.imageExtension_ = options.imageExtension ||
|
78 |
this.MARKER_CLUSTER_IMAGE_EXTENSION_;
|
79 |
+
this.zoomOnClick_ = options.zoomOnClick || true;
|
80 |
|
81 |
this.setupStyles_();
|
82 |
|
86 |
var that = this;
|
87 |
google.maps.event.addListener(this.map_, 'zoom_changed', function() {
|
88 |
that.resetViewport();
|
89 |
+
that.redraw();
|
90 |
});
|
91 |
|
92 |
+
google.maps.event.addListener(this.map_, 'drag', function() {
|
93 |
that.redraw();
|
94 |
});
|
95 |
|
106 |
* @type {string}
|
107 |
* @private
|
108 |
*/
|
109 |
+
//TODO(lukem): Update before submitting.
|
110 |
MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_PATH_ =
|
111 |
'http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/' +
|
112 |
'images/m';
|
322 |
marker.setVisible(false);
|
323 |
marker.setMap(null);
|
324 |
marker.isAdded = false;
|
325 |
+
if (marker.draggable) {
|
326 |
// If the marker is draggable add a listener so we update the clusters on
|
327 |
// the drag end.
|
328 |
var that = this;
|
329 |
google.maps.event.addListener(marker, 'dragend', function() {
|
|
|
330 |
that.resetViewport();
|
331 |
that.redraw();
|
332 |
});
|
454 |
* @return {google.maps.LatLngBounds} The extended bounds.
|
455 |
*/
|
456 |
MarkerClusterer.prototype.getExtendedBounds = function(bounds) {
|
457 |
+
|
458 |
var projection = this.getProjection();
|
459 |
|
460 |
// Turn the bounds into latlng.
|
547 |
}
|
548 |
|
549 |
// Get our current map view bounds.
|
550 |
+
var bounds = this.getExtendedBounds(this.map_.getBounds());
|
|
|
|
|
|
|
551 |
|
552 |
for (var i = 0, marker; marker = this.markers_[i]; i++) {
|
553 |
var added = false;
|
554 |
if (!marker.isAdded && this.isMarkerInBounds_(marker, bounds)) {
|
555 |
for (var j = 0, cluster; cluster = this.clusters_[j]; j++) {
|
556 |
+
if (cluster.getCenter() &&
|
557 |
cluster.isMarkerInClusterBounds(marker)) {
|
558 |
added = true;
|
559 |
cluster.addMarker(marker);
|
|
|
560 |
}
|
561 |
}
|
562 |
|
828 |
* @private
|
829 |
*/
|
830 |
ClusterIcon.prototype.getPosFromLatLng_ = function(latlng) {
|
831 |
+
var projection = this.getProjection();
|
832 |
+
var pos = projection.fromLatLngToDivPixel(latlng);
|
833 |
pos.x -= parseInt(this.width_ / 2, 10);
|
834 |
pos.y -= parseInt(this.height_ / 2, 10);
|
835 |
return pos;
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Pz_WorldMap</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/afl-3.0.php">Academic Free License (AFL 3.0)</license>
|
7 |
<channel>community</channel>
|
@@ -10,7 +10,10 @@
|
|
10 |
<description>Online user's world map, show who is online and where they are.
|
11 |
|
12 |
Widget for google map.</description>
|
13 |
-
<notes>v 1.0.
|
|
|
|
|
|
|
14 |
update google map api to version 3
|
15 |
|
16 |
v 1.0.5:
|
@@ -45,9 +48,9 @@ v 0.6:
|
|
45 |
v 0.5:
|
46 |
first release package</notes>
|
47 |
<authors><author><name>Cheng Wei</name><user>auto-converted</user><email>berlios.o@gmail.com</email></author></authors>
|
48 |
-
<date>2010-12-
|
49 |
-
<time>
|
50 |
-
<contents><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><file name="customer-flag.png" hash="8f33bab9b0c154462489b35140f29fae"/><file name="guest-flag.png" hash="47c715944bf946fd0cd9528cd8a016ae"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><file name="customer-flag.png" hash="8f33bab9b0c154462489b35140f29fae"/><file name="guest-flag.png" hash="47c715944bf946fd0cd9528cd8a016ae"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="worldmap.xml" hash="9b9b6e88fbe0b7086ecae0d4e5a0a4c2"/></dir><dir name="template"><dir name="worldmap"><dir name="info"><file name="geomap.phtml" hash="090e5dd9fbf704864c0c5488fa5c6fbe"/></dir><dir name="map"><file name="country.phtml" hash="c9994c2fd6c01dcd578f6853f0e51c3a"/><file name="marker.phtml" hash="903e2d2f451d28fc1563f15c2d5ef1cd"/><file name="region.phtml" hash="65216785a0a95545890273b2ef314c96"/></dir><dir name="page"><file name="head.phtml" hash="
|
51 |
<compatible/>
|
52 |
<dependencies/>
|
53 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Pz_WorldMap</name>
|
4 |
+
<version>1.0.7</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/afl-3.0.php">Academic Free License (AFL 3.0)</license>
|
7 |
<channel>community</channel>
|
10 |
<description>Online user's world map, show who is online and where they are.
|
11 |
|
12 |
Widget for google map.</description>
|
13 |
+
<notes>v 1.0.7:
|
14 |
+
fix issue of marker cluster
|
15 |
+
|
16 |
+
v 1.0.6:
|
17 |
update google map api to version 3
|
18 |
|
19 |
v 1.0.5:
|
48 |
v 0.5:
|
49 |
first release package</notes>
|
50 |
<authors><author><name>Cheng Wei</name><user>auto-converted</user><email>berlios.o@gmail.com</email></author></authors>
|
51 |
+
<date>2010-12-21</date>
|
52 |
+
<time>03:10:19</time>
|
53 |
+
<contents><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><file name="customer-flag.png" hash="8f33bab9b0c154462489b35140f29fae"/><file name="guest-flag.png" hash="47c715944bf946fd0cd9528cd8a016ae"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><file name="customer-flag.png" hash="8f33bab9b0c154462489b35140f29fae"/><file name="guest-flag.png" hash="47c715944bf946fd0cd9528cd8a016ae"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="worldmap.xml" hash="9b9b6e88fbe0b7086ecae0d4e5a0a4c2"/></dir><dir name="template"><dir name="worldmap"><dir name="info"><file name="geomap.phtml" hash="090e5dd9fbf704864c0c5488fa5c6fbe"/></dir><dir name="map"><file name="country.phtml" hash="c9994c2fd6c01dcd578f6853f0e51c3a"/><file name="marker.phtml" hash="903e2d2f451d28fc1563f15c2d5ef1cd"/><file name="region.phtml" hash="65216785a0a95545890273b2ef314c96"/></dir><dir name="page"><file name="head.phtml" hash="b757ae90ce9a403f6485658b2c200c43"/></dir><dir name="widget"><dir name="map"><file name="selector.phtml" hash="288254500d326f7666d98667c43ca2a1"/></dir><dir name="marker"><file name="container.phtml" hash="1f3708de3e776a59ab32b123df50b15b"/></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="worldmap.xml" hash="3125174c306ac57e2a31b554b2a5666b"/></dir><dir name="template"><dir name="worldmap"><file name="map.phtml" hash="98c21afd0f5000a45b3cd5983a2b7619"/><file name="online.phtml" hash="c9c1af2b4d0dca3496275aa646ff300d"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="map"><file name="markerclusterer.js" hash="888ca22432babba0581ef0556cce0f6d"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Pz_WorldMap.xml" hash="830c817474800247b94067a37c0dcb94"/></dir></target><target name="magelib"><dir name="PEAR"><dir name="Net"><dir name="GeoIP"><file name="DMA.php" hash="3041b17a8aab69ec3b63c017f1a0432d"/><file name="Location.php" hash="ddb36e4e7cacc2a50b67192a0eb79663"/></dir><file name="GeoIP.php" hash="e7bec2e088af4b24a27864f50a473b88"/></dir><dir name="PEAR"><file name="Exception.php" hash="f364e75223744d460a6bb08420ac94f9"/></dir></dir></target><target name="magecommunity"><dir name="Pz"><dir name="WorldMap"><dir name="Block"><dir name="Adminhtml"><dir name="Online"><dir name="Map"><file name="Geomap.php" hash="3821ff82dd0e2037ffed5b1f482e7e9c"/></dir><file name="Tabs.php" hash="d5b84909747d829fb70f166ffa70ac0e"/></dir><dir name="Widget"><dir name="Map"><file name="Selector.php" hash="d3c9eba22a61d6042755ce52142a2566"/></dir><dir name="Marker"><file name="Chooser.php" hash="7f6e16e50100c6936206c53c02c34b41"/></dir></dir></dir><dir name="Map"><file name="Abstract.php" hash="bc441844fa24409974bcac500eef2ef7"/></dir><file name="Links.php" hash="98cb18aa80b6e1addee1e09208baa1b6"/><file name="Map.php" hash="3d6d9a2344325adad25470fbfa92f30a"/><file name="Online.php" hash="891861764c00906bce6880f877dc901f"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="OnlineController.php" hash="a5ef08f28b95d240d8e11be553bd1301"/></dir><file name="IndexController.php" hash="5c607322b69e192c96e366d2682fae71"/></dir><dir name="etc"><file name="config.xml" hash="335c9711823af60af762d3556e18f25a"/><file name="system.xml" hash="3f8f175f4c162f743e3dc9ac3fa39dfa"/><file name="widget.xml" hash="61a72497df972e2009df7b56b84e449e"/></dir><dir name="Helper"><file name="Data.php" hash="cb91df6e8ce5572afc3170908cec2710"/></dir><dir name="Model"><dir name="Entity"><dir name="Visitor"><file name="Online.php" hash="c38d1dd15e4b63fbc45696c8e80f741a"/></dir><file name="Setup.php" hash="5a8ce3adef8cf0389c16d9bae073e1a8"/><file name="Visitor.php" hash="8e17410114896ad10bc9a0c1e8bb3518"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Region.php" hash="4f4f07e53521b7a7e408c67a912346f0"/></dir></dir></dir><file name="Ip.php" hash="c5c991a76a37384373ec53aa7808ec22"/><file name="Observe.php" hash="dd9e9487d5d17a4ade1c5784e20b2601"/><file name="Visitor.php" hash="65ab2dc020e82ab51dc19d5f6a9519f5"/></dir><dir name="sql"><dir name="worldmap_setup"><file name="mysql4-install-0.1.0.php" hash="1228c98bf7b826922f62892bb87e46c8"/><file name="mysql4-upgrade-0.1.0-0.8.0.php" hash="db893e0bd0fd8cf1ac21d7af923c8d02"/><file name="mysql4-upgrade-0.9.6-1.0.0.php" hash="a6639ea73faf46ddad49316969373248"/></dir></dir></dir></dir></target></contents>
|
54 |
<compatible/>
|
55 |
<dependencies/>
|
56 |
</package>
|