Permalink
Browse files

tweaked gspot marker functions

  • Loading branch information...
1 parent 9c6ce3b commit 0b06270a6831124f2822838e79bc1f73704e2806 @msmalley committed Nov 4, 2011
Showing with 58 additions and 27 deletions.
  1. +2 −2 README.md
  2. +53 −14 js/g-spot.js
  3. +0 −3 js/g-spot.min.js
  4. +3 −8 mb/classes/mb_db.class.php
View
@@ -3,9 +3,9 @@
* Follow [Mark on Twitter](http://twitter.com/m_smalley) for more updates
# The Basic Features:
-* 7 Million + Geo-Spatially Indexed MongoDB Places
+* 7.9 Million + Geo-Spatially Indexed MongoDB Places
* Out of the box marker clustering and customized InfoWindows
-* A heap of exciting things to come, including polygons and layers
+* A heap of exciting things to come, including OSM, polygons and layers
# Installation Instructions:
* Ensure MongoDB and Mongo PHP Drivers Working
View
@@ -307,6 +307,7 @@
/* ESTABLISH ACTIONS */
function removeInfoBox(ib) {
return function() {
+ //this_box = remove_infobox(this_box);
ib.setMap(null);
};
}
@@ -361,7 +362,7 @@
this.boundsChangedListener_ = null;
}
- function construct_infobox(this_id,map_id,opts,this_url,title,content){
+ function construct_infobox(this_id,map_id,opts,this_url,title,content,open_only){
info_box[map_id][this_id] = function(map_id,opts){
create_infobox(this,map_id,opts,this_id);
}
@@ -378,11 +379,20 @@
info_box[map_id][this_id].prototype.panMap = function() {
pan_infobox(this);
};
- new_info_box[map_id] = [];
- new_info_box[map_id][this_id] = new info_box[map_id][this_id](
- map_id,
- {latlng: marker[map_id][this_id].getPosition(), map: marker[map_id][this_id].map}
- );
+ if(open_only){
+ new_info_box[map_id] = [];
+ new_info_box[map_id][this_id] = null;
+ new_info_box[map_id][this_id] = new info_box[map_id][this_id](
+ map_id,
+ {latlng: marker[map_id][this_id].getPosition(), map: marker[map_id][this_id].map}
+ );
+ }else{
+ new_info_box[map_id] = [];
+ new_info_box[map_id][this_id] = new info_box[map_id][this_id](
+ map_id,
+ {latlng: marker[map_id][this_id].getPosition(), map: marker[map_id][this_id].map}
+ );
+ }
}
/* MARKER FUNCTIONS */
@@ -428,14 +438,43 @@
}
google.maps.event.addListener(marker[map_id][this_id], "click", function(e) {
if(!info_box[map_id][this_id]){
- construct_infobox(
- this_id,
- map_id,
- {latlng: marker[map_id][this_id].getPosition(), map: marker[map_id][this_id].map},
- this_url,
- title,
- content
- );
+ if(new_info_box[map_id][this_id]){
+ if(new_info_box[map_id][this_id]['div_']===null){
+ construct_infobox(
+ this_id,
+ map_id,
+ {latlng: marker[map_id][this_id].getPosition(), map: marker[map_id][this_id].map},
+ this_url,
+ title,
+ content,
+ false
+ );
+ }
+ }else{
+ construct_infobox(
+ this_id,
+ map_id,
+ {latlng: marker[map_id][this_id].getPosition(), map: marker[map_id][this_id].map},
+ this_url,
+ title,
+ content,
+ false
+ );
+ }
+ }else{
+ if(new_info_box[map_id][this_id]){
+ if(new_info_box[map_id][this_id]['div_']===null){
+ construct_infobox(
+ this_id,
+ map_id,
+ {latlng: marker[map_id][this_id].getPosition(), map: marker[map_id][this_id].map},
+ this_url,
+ title,
+ content,
+ true
+ );
+ }
+ }
}
});
marker_count++;
Oops, something went wrong.

0 comments on commit 0b06270

Please sign in to comment.