// manages google maps (function($){ var centerLat; var centerLong; var zoom; var mapConfig; var cluster; var map; // initialization $.fn.russianmap_initialize = function(region) { switch (region) { case 'sud' : this.centerLat = 44.902577996288876; this.centerLong = 43.22021484375; this.zoom = 6; break; case 'central' : this.centerLat = 54.6992335284814; this.centerLong = 38.64990234375; this.zoom = 6; break; case 'volga' : this.centerLat = 54.826007999094955; this.centerLong = 54.66796875; this.zoom = 5; break; case 'nordouest' : this.centerLat = 64.30182213914463; this.centerLong = 42.36328125; this.zoom = 5; break; case 'oural' : this.centerLat = 58.676937672586924; this.centerLong = 71.103515625; this.zoom = 5; break; case 'siberie' : this.centerLat = 62.2679226294176; this.centerLong = 98.26171875; this.zoom = 4; break; case 'extremeorient' : this.centerLat = 64.92354174306496; this.centerLong = 159.609375; this.zoom = 3; break; case 'russie' : default : this.centerLat = 58.722599; this.centerLong = 79.1015625; this.zoom = 3; break; } this.mapConfig = {zoom:this.zoom,centerLat:this.centerLat,centerLong:this.centerLong}; }; // create the map $.fn.create_map = function(mapId,region) { if (GBrowserIsCompatible()) { this.russianmap_initialize(region); var latlng = new GLatLng(this.mapConfig.centerLat,this.mapConfig.centerLong); this.map = new GMap2(document.getElementById(mapId)); this.map.setCenter(latlng, this.mapConfig.zoom); // this.map.addControl(new GMapTypeControl(), new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(7, 7))); this.map.addControl(new GLargeMapControl(), new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(7, 28))); var marker, markersArray=[]; // json data already loaded from markers.php for (var i=0; i'+title+'

'); }); return marker; } $.fn.toggleClustering = function() { this.cluster.clusteringEnabled =! this.cluster.clusteringEnabled; this.cluster.refresh(true); // true required to force a full update of the markers - otherwise the update would occur next time that the map is zoomed or the active markers change } })(jQuery); jQuery(document).ready(function() { var map = ($('#map')); if (map.length>0){ $.fn.create_map("map","russie"); $("._minimap").click(function(){ $.fn.create_map("map",$(this).children("img").attr("alt")); $(".activeMap").removeClass("activeMap"); $(this).addClass("activeMap"); }); } });