onSearch: function () {
var map = this.map;
var address = this.getView().byId("SearchInput").getValue();
var geocoder = new google.maps.Geocoder();
this.geocoder.geocode({ 'address': address }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
var marker = new google.maps.Marker({
map: map,
position: results[0].geometry.location
});
} else {
sap.m.MessageToast.show("Geocode was not successful for the following reason:"+ status);
}
});
var lat= " " ;
var log= " " ;
var latLng = new google.maps.LatLng(lat,log);
geocoder.geocode({
latLng: latLng
},
function(responses)
{
if (responses && responses.length > 0)
{
var formatedAddress=responses[0].formatted_address;
sap.m.MessageToast.show("You have selected : " + formatedAddress,);
}
else
{
sap.m.MessageToast.show('Not getting Any address for given latitude and longitude.');
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
10 | |
7 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |