|
112 | 112 | if (inputBinding.locationNameInput) {
|
113 | 113 | inputBinding.locationNameInput.val(gmapContext.locationName);
|
114 | 114 | }
|
115 |
| - } |
116 |
| - |
| 115 | + } |
| 116 | + |
117 | 117 | function setupInputListenersInput(inputBinding, gmapContext) {
|
118 | 118 | if (inputBinding) {
|
119 | 119 | if (inputBinding.radiusInput){
|
120 | 120 | inputBinding.radiusInput.on("change", function() {
|
121 | 121 | gmapContext.radius = $(this).val();
|
122 |
| - GmUtility.setPosition(gmapContext, gmapContext.location); |
| 122 | + GmUtility.setPosition(gmapContext, gmapContext.location, function(context){ |
| 123 | + context.settings.onchanged(GmUtility.locationFromLatLng(context.location), context.radius, false); |
| 124 | + }); |
123 | 125 | });
|
124 | 126 | }
|
125 | 127 | if (inputBinding.locationNameInput && gmapContext.settings.enableAutocomplete) {
|
|
130 | 132 | gmapContext.onlocationnotfound();
|
131 | 133 | return;
|
132 | 134 | }
|
133 |
| - GmUtility.setPosition(gmapContext, place.geometry.location, function() { |
134 |
| - updateInputValues(inputBinding, gmapContext); |
| 135 | + GmUtility.setPosition(gmapContext, place.geometry.location, function(context) { |
| 136 | + updateInputValues(inputBinding, context); |
| 137 | + context.settings.onchanged(GmUtility.locationFromLatLng(context.location), context.radius, false); |
135 | 138 | });
|
136 | 139 | });
|
137 | 140 | }
|
| 141 | + if (inputBinding.latitudeInput) { |
| 142 | + inputBinding.latitudeInput.on("change", function() { |
| 143 | + GmUtility.setPosition(gmapContext, new google.maps.LatLng($(this).val(), gmapContext.location.lng()), function(context){ |
| 144 | + context.settings.onchanged(GmUtility.locationFromLatLng(context.location), context.radius, false); |
| 145 | + }); |
| 146 | + }); |
| 147 | + } |
| 148 | + if (inputBinding.longitudeInput) { |
| 149 | + inputBinding.longitudeInput.on("change", function() { |
| 150 | + GmUtility.setPosition(gmapContext, new google.maps.LatLng(gmapContext.location.lat(), $(this).val()), function(context){ |
| 151 | + context.settings.onchanged(GmUtility.locationFromLatLng(context.location), context.radius, false); |
| 152 | + }); |
| 153 | + }); |
| 154 | + } |
138 | 155 | }
|
139 | 156 | }
|
140 | 157 |
|
|
0 commit comments