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',
44 fieldLabel : 'Location',
46 render : function (_self) {
47 _this.location = _self;
60 xtype : 'LocationPicker',
62 style : 'width:500px; height: 400px; border: 1px solid #000;margin:50px auto;',
63 latitude : 46.15242437752303,
64 longitude : 2.7470703125,
66 render : function (_self) {
69 this.gMapContext.autocomplete = new google.maps.places.Autocomplete(_this.location.inputEl().dom);
71 google.maps.event.addListener(this.gMapContext.autocomplete, "place_changed", function() {
72 var place = _this.picker.gMapContext.autocomplete.getPlace();
73 if (!place.geometry) {
74 Roo.log('location not found');
77 GmUtility.setPosition(gmapContext, place.geometry.location, function(context) {
78 updateInputValues(inputBinding, context);
79 context.settings.onchanged.apply(gmapContext.domContainer, [ GmUtility.locationFromLatLng(context.location), context.radius, false ]);
83 positionchanged : function (_self, location) {
85 _this.latitude.setValue(location.lat());
89 _this.longitude.setValue(location.lng());
108 fieldLabel : 'Latitude',
111 render : function (_self) {
112 _this.latitude = _self;
126 fieldLabel : 'Longitude',
129 render : function (_self) {
130 _this.longitude = _self;