Changeset 841
- Timestamp:
- 08/29/08 04:42:32 (3 months ago)
- Location:
- plugins/googlemaps/trunk
- Files:
-
- 2 modified
-
googlemaps.plugin.php (modified) (2 diffs)
-
js/googlemaps.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
plugins/googlemaps/trunk/googlemaps.plugin.php
r811 r841 28 28 'license' => 'Apache License 2.0', 29 29 'description' => 'easily/quickly insert Google Maps into your posts.', 30 'guid' => '14c8414f-6cdf-11dd-b14a-001b210f913f' 30 31 ); 31 32 } … … 74 75 public function action_update_check() 75 76 { 76 Update::add('Google Maps', '14c8414f-6cdf-11dd-b14a-001b210f913f', $this->info->version);77 Update::add('Google Maps', $this->info->guid, $this->info->version); 77 78 } 78 79 -
plugins/googlemaps/trunk/js/googlemaps.js
r811 r841 45 45 } 46 46 47 var width = 0; 48 var height = 0; 49 var _size_r = query.match(/(\?|&|&)_size=(\d+)x(\d+)/); 50 if (_size_r) { 51 width = _size_r[2]; 52 height = _size_r[3]; 53 } 54 55 var controls = ''; 56 var _controls_r = query.match(/(\?|&|&)_controls=(none)/); 57 if (_controls_r) { 58 controls = _controls_r[2]; 59 } 60 61 var markers = []; 62 var _markers_r = query.match(/(\?|&|&)_markers=([\d\-\.\,\|]+)/); 63 if (_markers_r) { 64 $.each(_markers_r[2].split('|'), function(k, marker) { 65 marker = marker.split(','); 66 markers.push(new google.maps.LatLng(marker[0], marker[1])); 67 }); 68 } 69 47 70 canvas = $('<div class="googlemaps-canvas"></div>'); 48 71 $(this).replaceWith(canvas); 49 72 50 73 if (layer == 'c') { 51 canvas.width(habari_googlemaps.streetview_width); 52 canvas.height(habari_googlemaps.streetview_height); 74 if (width == 0 || height == 0) { 75 width = habari_googlemaps.streetview_width; 76 height = habari_googlemaps.streetview_height; 77 } 78 canvas.width(width); 79 canvas.height(height); 53 80 var pov = { yaw: cbp[1], pitch: cbp[4], zoom: cbp[3] }; 54 81 options = { latlng: new google.maps.LatLng(cblat, cblng), pov: pov }; … … 61 88 }); 62 89 } else { 63 map = new google.maps.Map2(canvas.get(0), {size: new GSize(habari_googlemaps.map_width, habari_googlemaps.map_height)}); 64 map.addControl(new google.maps.MapTypeControl()); 65 map.addControl(new google.maps.LargeMapControl()); 90 if (width == 0 || height == 0) { 91 width = habari_googlemaps.map_width; 92 height = habari_googlemaps.map_height; 93 } 94 map = new google.maps.Map2(canvas.get(0), {size: new GSize(width, height)}); 95 if (controls != 'none') { 96 map.addControl(new google.maps.MapTypeControl()); 97 map.addControl(new google.maps.LargeMapControl()); 98 } 66 99 map.enableScrollWheelZoom(); 67 100 map.enableContinuousZoom(); … … 74 107 map.setMapType(G_NORMAL_MAP); 75 108 } 109 110 $.each(markers, function(k, marker) { 111 map.addOverlay(new google.maps.Marker(marker)); 112 }); 76 113 } 77 114 });
