codesite-noreply at google.com
2009-Sep-21 08:51 UTC
[Mapstraction] [mapstraction] r34 committed - removed deprecated method draggable, all controls off when first creat...
Revision: 34 Author: freyfogle Date: Mon Sep 21 00:21:06 2009 Log: removed deprecated method draggable, all controls off when first creating the map, bit of work on adding controls, though still doesnt seem to be working correctly http://code.google.com/p/mapstraction/source/detail?r=34 Modified: /trunk/source/mxn.googlev3.core.js ======================================--- /trunk/source/mxn.googlev3.core.js Sun Sep 20 07:01:02 2009 +++ /trunk/source/mxn.googlev3.core.js Mon Sep 21 00:21:06 2009 @@ -5,7 +5,12 @@ init: function(element, api){ var me = this; if ( google && google.maps ){ - var map = new google.maps.Map(element, {mapTypeId:google.maps.MapTypeId.ROADMAP}); + // be default no controls and road map + var myOptions = { + disableDefaultUI: true, + mapTypeId: google.maps.MapTypeId.ROADMAP + }; + var map = new google.maps.Map(element, myOptions); // deal with click @@ -28,8 +33,15 @@ }, applyOptions: function(){ - var map = this.maps[this.api]; - // TODO: Add provider code + var map = this.maps[this.api]; + var myOptions = []; + if (this.options.enableDragging) { + myOptions.draggable = true; + } + if (this.options.enableScrollWheelZoom){ + myOptions.scrollwheel = true; + } + map.setOptions(myOptions); }, resizeTo: function(width, height){ @@ -50,11 +62,20 @@ this.addSmallControls(); } } + if (args.scale){ + var myOptions = { + scaleControl:true, + scaleControlOptions: {style:google.maps.ScaleControlStyle.DEFAULT} + }; + map.setOptions(myOptions); + this.addControlsArgs.scale = true; + } }, addSmallControls: function() { var map = this.maps[this.api]; var myOptions = { + scrollwheel: false, navigationControl:true, navigationControlOptions: {style:google.maps.NavigationControlStyle.SMALL} }; @@ -85,12 +106,6 @@ this.addControlsArgs.map_type = true; }, - dragging: function(on) { - var map = this.maps[this.api]; - - // TODO: Add provider code - }, - setCenterAndZoom: function(point, zoom) { var map = this.maps[this.api]; var pt = point.toProprietary(this.api);
Maybe Matching Threads
- r30 committed - jslint now passing for google and googlev3
- [mapstraction commit] r12 - Implemented most Cloudmade functions. Still requires image, tile and KML/GeoRSS overlays
- API Google MAPS
- r54 committed - ...
- r75 committed - turn off scrollwheel on by default, can then be activated vi applyOpti...