Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using map_options causes paginate to break #10

Open
jeperkins4 opened this issue Mar 3, 2011 · 2 comments
Open

Using map_options causes paginate to break #10

jeperkins4 opened this issue Mar 3, 2011 · 2 comments

Comments

@jeperkins4
Copy link

The listings in the side bar paginate, but the map doesn't with the following code...

$(document).bind('init_finished.quickpaginate', function(e){
$('#map').jMapping({
location_selector: '.map-location:visible',
map_config: {
scrollwheel: false,
mapTypeId: google.maps.MapTypeId.ROADMAP,
scaleControl: true
}
});
});

@cartuchogl
Copy link

I wrote a custom pagination with $.ajax and if I specify map_config first marks never removed.
I fix that adding zoom: 9 param on map_config.
I modify createMap function (jquery.jmapping.js on line 71) to avoid the problem

var createMap = function(){
  var default_config = {
    navigationControlOptions: {
      style: google.maps.NavigationControlStyle.SMALL
    },
    mapTypeControl: false,
    mapTypeId: google.maps.MapTypeId.ROADMAP,
    zoom: 9
  };
  if (settings.map_config){
    map = new google.maps.Map(map_elm, $.extend(default_config,settings.map_config));
  } else {
    map = new google.maps.Map(map_elm, default_config);
  }
  map.fitBounds(bounds);
  if (settings.force_zoom_level){
    map.setZoom(settings.force_zoom_level);
  }
  return map;
};

@mokolabs
Copy link
Contributor

Thanks! This worked for me.

If your map markers are disappearing when zooming on maps with custom map config options -- with an error message that mentions grid[x] being undefined -- this will also fix that issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants