roojs-bootstrap.js
authorEdward <edward@roojs.com>
Tue, 26 May 2015 02:19:07 +0000 (10:19 +0800)
committerEdward <edward@roojs.com>
Tue, 26 May 2015 02:19:07 +0000 (10:19 +0800)
roojs-bootstrap-debug.js

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

index e5f98aa..f6c58f4 100644 (file)
@@ -20980,12 +20980,12 @@ Roo.extend(Roo.bootstrap.LocationPicker, Roo.bootstrap.Component,  {
     
     initEvents: function(ct, position)
     {   
-        
+        this.initial();
     },
     
     initial: function()
     {
-        if (this.isApplied()){
+        if(!this.el.getWidth() || this.isApplied()){
             return;
         }
         
index 2fdb61b..2825979 100644 (file)
@@ -464,7 +464,7 @@ 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({positionchanged:true});};Roo.extend(Roo.bootstrap.LocationPicker,Roo.bootstrap.Component,{gMapContext:false,latitude:0,longitude:0,zoom:15,mapTypeId:google.maps.MapTypeId.ROADMAP,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){},initial:function(){if(this.isApplied()){return;}
+Roo.bootstrap.LocationPicker=function(A){Roo.bootstrap.LocationPicker.superclass.constructor.call(this,A);this.addEvents({positionchanged:true});};Roo.extend(Roo.bootstrap.LocationPicker,Roo.bootstrap.Component,{gMapContext:false,latitude:0,longitude:0,zoom:15,mapTypeId:google.maps.MapTypeId.ROADMAP,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){this.initial();},initial:function(){if(!this.el.getWidth()||this.isApplied()){return;}
 this.gMapContext=this.GMapContext();var A=this;google.maps.event.addListener(this.gMapContext.marker,"dragend",function(B){A.setPosition(A.gMapContext.marker.position);});this.setPosition(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);}});}
 this.fireEvent('positionchanged',this,A);},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=A.length-1;i>=0;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("locality")>=0){B.city=C.short_name;}else if(C.types.indexOf("neighborhood")>=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;}});