3 Roo.example = Roo.example || {};
5 Roo.example.locationpicker = new Roo.XComponent({
6 part : ["layout","viewpanel"],
7 order : '001-viewpanel',
10 name : "unnamed module",
17 el : new Roo.bootstrap.Body()
19 this.parent.el.layout = false;
20 this.parent.el.render(document.body);
38 cls : 'col-md-offset-3',
39 style : 'margin-top: 50px',
45 html : "This requires an API now"
59 cls : 'col-md-offset-3',
60 style : 'margin-top: 50px',
65 fieldLabel : 'Location',
67 render : function (_self) {
68 _this.location = _self;
81 xtype : 'LocationPicker',
83 style : 'width:500px; height: 400px; border: 1px solid #000;margin:50px auto;',
85 longitude : 114.1751471,
86 markerTitle : 'Drag Me',
88 render : function (_self) {
91 this.gMapContext.autocomplete = new google.maps.places.Autocomplete(_this.location.inputEl().dom);
93 google.maps.event.addListener(this.gMapContext.autocomplete, "place_changed", function() {
94 var place = _this.picker.gMapContext.autocomplete.getPlace();
95 if (!place.geometry) {
96 Roo.log('location not found');
99 _this.picker.setPosition(place.geometry.location);
103 positionchanged : function (_self, location) {
105 _this.latitude.setValue(location.lat());
109 _this.longitude.setValue(location.lng());
128 fieldLabel : 'Latitude',
131 render : function (_self) {
132 _this.latitude = _self;
146 fieldLabel : 'Longitude',
149 render : function (_self) {
150 _this.longitude = _self;