Skip to content

Commit

Permalink
Uncache metadata on update
Browse files Browse the repository at this point in the history
  • Loading branch information
brianjlandau committed Jul 11, 2010
1 parent 25e8611 commit b8ba795
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions jquery.jmapping.js
Expand Up @@ -33,7 +33,7 @@ if (GMap2){
$(info_window_selector).hide();

places = getPlaces();
bounds = getBounds();
bounds = getBounds(doUpdate);

if (doUpdate){
gmarkers = {};
Expand Down Expand Up @@ -82,14 +82,17 @@ if (GMap2){
return $(settings.side_bar_selector+' '+settings.location_selector);
};

var getPlacesData = function(){
var getPlacesData = function(doUpdate){
return places.map(function(){
if (doUpdate){
$(this).data('metadata', false);
}
return $(this).metadata(settings.metadata_options);
});
};

var getBounds = function(){
var places_data = getPlacesData();
var getBounds = function(doUpdate){
var places_data = getPlacesData(doUpdate);
var newBounds = new GLatLngBounds(
$.jMapping.makeGLatLng(places_data[0].point),
$.jMapping.makeGLatLng(places_data[0].point) );
Expand Down Expand Up @@ -185,6 +188,7 @@ if (GMap2){
getPlaces: getPlaces,
update: function(){
if ($(document).trigger('beforeUpdate.jMapping', [this]) != false){

init(true);
this.map = map;
this.gmarkers = gmarkers;
Expand Down

0 comments on commit b8ba795

Please sign in to comment.