roojs-bootstrap.js
authorEdward <edward@roojs.com>
Wed, 26 Aug 2015 10:37:27 +0000 (18:37 +0800)
committerEdward <edward@roojs.com>
Wed, 26 Aug 2015 10:37:27 +0000 (18:37 +0800)
roojs-bootstrap-debug.js

roojs-bootstrap-debug.js
roojs-bootstrap.js

index f35f88d..122d9fd 100644 (file)
@@ -21249,7 +21249,6 @@ Roo.extend(Roo.bootstrap.Tooltip, Roo.bootstrap.Component,  {
  * @cfg {Boolean} enableAutocomplete default false
  * @cfg {Boolean} enableReverseGeocode default true
  * @cfg {String} markerTitle
- * @cfg {Array} styles
  * 
  * @constructor
  * Create a new LocationPicker
@@ -21344,7 +21343,6 @@ Roo.extend(Roo.bootstrap.LocationPicker, Roo.bootstrap.Component,  {
     enableAutocomplete: false,
     enableReverseGeocode: true,
     markerTitle: '',
-    styles: [],
     
     getAutoCreate: function()
     {
@@ -21383,14 +21381,11 @@ Roo.extend(Roo.bootstrap.LocationPicker, Roo.bootstrap.Component,  {
         });
         
         google.maps.event.addListener(this.gMapContext.map, 'click', function(event){
-            Roo.log('click');
-            Roo.log(event);
             _this.fireEvent('mapClick', this, event);
             
         });
 
         google.maps.event.addListener(this.gMapContext.map, 'rightclick', function(event){
-            Roo.log('right click');
             _this.fireEvent('mapRightClick', this, event);
             
         });
index 96f8e51..f29df53 100644 (file)
@@ -472,8 +472,8 @@ this.el.select('.tooltip-inner',true).first().dom.innerHTML=this.bindEl.attr('to
 this.el.show();this.el.addClass(A);var p=this.getPosition();var D=this.el.getBox();if(C){}var E=Roo.bootstrap.Tooltip.alignment[A]this.el.alignTo(this.bindEl,E[0],E[1]);this.el.addClass('in fade');this.hoverState=null;if(this.el.hasClass('fade')){}},hide:function(){if(!this.el){return;}
 this.el.removeClass('in');}});
 //Roo/bootstrap/LocationPicker.js
-Roo.bootstrap.LocationPicker=function(A){Roo.bootstrap.LocationPicker.superclass.constructor.call(this,A);this.addEvents({initial:true,positionchanged:true,resize:true,show:true,hide:true,mapClick:true,mapRightClick:true,markerClick:true,markerRightClick:true});};Roo.extend(Roo.bootstrap.LocationPicker,Roo.bootstrap.Component,{gMapContext:false,latitude:0,longitude:0,zoom:15,mapTypeId:false,mapTypeControl:false,disableDoubleClickZoom:false,scrollwheel:true,streetViewControl:false,radius:0,locationName:'',draggable:true,enableAutocomplete:false,enableReverseGeocode:true,markerTitle:'',styles:[],getAutoCreate:function(){var A={tag:'div',cls:'roo-location-picker'};return A},initEvents:function(ct,A){if(!this.mapTypeId){this.mapTypeId=google.maps.MapTypeId.ROADMAP;}if(!this.el.getWidth()||this.isApplied()){return;}
-this.el.setVisibilityMode(Roo.Element.DISPLAY);this.initial();},initial:function(){this.gMapContext=this.GMapContext();var A=this;google.maps.event.addListener(this.gMapContext.marker,"dragend",function(B){A.setPosition(A.gMapContext.marker.position);});google.maps.event.addListener(this.gMapContext.map,'click',function(B){Roo.log('click');Roo.log(B);A.fireEvent('mapClick',this,B);});google.maps.event.addListener(this.gMapContext.map,'rightclick',function(B){Roo.log('right click');A.fireEvent('mapRightClick',this,B);});google.maps.event.addListener(this.gMapContext.marker,'click',function(B){A.fireEvent('markerClick',this,B);});google.maps.event.addListener(this.gMapContext.marker,'rightclick',function(B){A.fireEvent('markerRightClick',this,B);});this.setPosition(this.gMapContext.location);this.fireEvent('initial',this,this.gMapContext.location);},isApplied:function(){return this.getGmapContext()==false?false:true;},getGmapContext:function(){return this.gMapContext},GMapContext:function(){var A=new google.maps.Map(this.el.dom,this);var B=new google.maps.Marker({position:new google.maps.LatLng(this.latitude,this.longitude),map:A,title:this.markerTitle,draggable:this.draggable});return {map:A,marker:B,circle:null,location:B.position,radius:this.radius,locationName:this.locationName,addressComponents:{formatted_address:null,addressLine1:null,addressLine2:null,streetName:null,streetNumber:null,city:null,district:null,state:null,stateOrProvince:null},settings:this,domContainer:this.el.dom,geodecoder:new google.maps.Geocoder()};},drawCircle:function(A,B,C){if(this.gMapContext.circle!=null){this.gMapContext.circle.setMap(null);}if(B>0){B*=1;C=Roo.apply({},C,{strokeColor:"#0000FF",strokeOpacity:.35,strokeWeight:2,fillColor:"#0000FF",fillOpacity:.2});C.map=this.gMapContext.map;C.radius=B;C.center=A;this.gMapContext.circle=new google.maps.Circle(C);return this.gMapContext.circle;}return null;},setPosition:function(A){this.gMapContext.location=A;this.gMapContext.marker.setPosition(A);this.gMapContext.map.panTo(A);this.drawCircle(A,this.gMapContext.radius,{});var B=this;if(this.gMapContext.settings.enableReverseGeocode){this.gMapContext.geodecoder.geocode({latLng:this.gMapContext.location},function(C,D){if(D==google.maps.GeocoderStatus.OK&&C.length>0){B.gMapContext.locationName=C[0].formatted_address;B.gMapContext.addressComponents=B.address_component_from_google_geocode(C[0].address_components);B.fireEvent('positionchanged',this,A);}});return;}
+Roo.bootstrap.LocationPicker=function(A){Roo.bootstrap.LocationPicker.superclass.constructor.call(this,A);this.addEvents({initial:true,positionchanged:true,resize:true,show:true,hide:true,mapClick:true,mapRightClick:true,markerClick:true,markerRightClick:true});};Roo.extend(Roo.bootstrap.LocationPicker,Roo.bootstrap.Component,{gMapContext:false,latitude:0,longitude:0,zoom:15,mapTypeId:false,mapTypeControl:false,disableDoubleClickZoom:false,scrollwheel:true,streetViewControl:false,radius:0,locationName:'',draggable:true,enableAutocomplete:false,enableReverseGeocode:true,markerTitle:'',getAutoCreate:function(){var A={tag:'div',cls:'roo-location-picker'};return A},initEvents:function(ct,A){if(!this.mapTypeId){this.mapTypeId=google.maps.MapTypeId.ROADMAP;}if(!this.el.getWidth()||this.isApplied()){return;}
+this.el.setVisibilityMode(Roo.Element.DISPLAY);this.initial();},initial:function(){this.gMapContext=this.GMapContext();var A=this;google.maps.event.addListener(this.gMapContext.marker,"dragend",function(B){A.setPosition(A.gMapContext.marker.position);});google.maps.event.addListener(this.gMapContext.map,'click',function(B){A.fireEvent('mapClick',this,B);});google.maps.event.addListener(this.gMapContext.map,'rightclick',function(B){A.fireEvent('mapRightClick',this,B);});google.maps.event.addListener(this.gMapContext.marker,'click',function(B){A.fireEvent('markerClick',this,B);});google.maps.event.addListener(this.gMapContext.marker,'rightclick',function(B){A.fireEvent('markerRightClick',this,B);});this.setPosition(this.gMapContext.location);this.fireEvent('initial',this,this.gMapContext.location);},isApplied:function(){return this.getGmapContext()==false?false:true;},getGmapContext:function(){return this.gMapContext},GMapContext:function(){var A=new google.maps.Map(this.el.dom,this);var B=new google.maps.Marker({position:new google.maps.LatLng(this.latitude,this.longitude),map:A,title:this.markerTitle,draggable:this.draggable});return {map:A,marker:B,circle:null,location:B.position,radius:this.radius,locationName:this.locationName,addressComponents:{formatted_address:null,addressLine1:null,addressLine2:null,streetName:null,streetNumber:null,city:null,district:null,state:null,stateOrProvince:null},settings:this,domContainer:this.el.dom,geodecoder:new google.maps.Geocoder()};},drawCircle:function(A,B,C){if(this.gMapContext.circle!=null){this.gMapContext.circle.setMap(null);}if(B>0){B*=1;C=Roo.apply({},C,{strokeColor:"#0000FF",strokeOpacity:.35,strokeWeight:2,fillColor:"#0000FF",fillOpacity:.2});C.map=this.gMapContext.map;C.radius=B;C.center=A;this.gMapContext.circle=new google.maps.Circle(C);return this.gMapContext.circle;}return null;},setPosition:function(A){this.gMapContext.location=A;this.gMapContext.marker.setPosition(A);this.gMapContext.map.panTo(A);this.drawCircle(A,this.gMapContext.radius,{});var B=this;if(this.gMapContext.settings.enableReverseGeocode){this.gMapContext.geodecoder.geocode({latLng:this.gMapContext.location},function(C,D){if(D==google.maps.GeocoderStatus.OK&&C.length>0){B.gMapContext.locationName=C[0].formatted_address;B.gMapContext.addressComponents=B.address_component_from_google_geocode(C[0].address_components);B.fireEvent('positionchanged',this,A);}});return;}
 this.fireEvent('positionchanged',this,A);},resize:function(){google.maps.event.trigger(this.gMapContext.map,"resize");this.gMapContext.map.setCenter(this.gMapContext.marker.position);this.fireEvent('resize',this);},setPositionByLatLng:function(A,B){this.setPosition(new google.maps.LatLng(A,B));},getCurrentPosition:function(){return {latitude:this.gMapContext.location.lat(),longitude:this.gMapContext.location.lng()};},getAddressName:function(){return this.gMapContext.locationName;},getAddressComponents:function(){return this.gMapContext.addressComponents;},address_component_from_google_geocode:function(A){var B={};for(var i=0;i<A.length;i++){var C=A[i];if(C.types.indexOf("postal_code")>=0){B.postalCode=C.short_name;}else if(C.types.indexOf("street_number")>=0){B.streetNumber=C.short_name;}else if(C.types.indexOf("route")>=0){B.streetName=C.short_name;}else if(C.types.indexOf("neighborhood")>=0){B.city=C.short_name;}else if(C.types.indexOf("locality")>=0){B.city=C.short_name;}else if(C.types.indexOf("sublocality")>=0){B.district=C.short_name;}else if(C.types.indexOf("administrative_area_level_1")>=0){B.stateOrProvince=C.short_name;}else if(C.types.indexOf("country")>=0){B.country=C.short_name;}}
 B.addressLine1=[B.streetNumber,B.streetName].join(" ").trim();B.addressLine2="";return B;},setZoomLevel:function(A){this.gMapContext.map.setZoom(A);},show:function(){if(!this.el){return;}
 this.el.show();this.resize();this.fireEvent('show',this);},hide:function(){if(!this.el){return;}