TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Adalat Khan
602
1.5k
870.5k
Autocomplete Address using Google API
Mar 18 2019 12:34 PM
I implemented Google Places Autocomplete TextBox with Place changed event but its not working in MVC Core framework. Please find out mistakes why the following code is not working in MVC Core Framework:
HTML Code:
<input type="text" id="txtFullAddress" />
//JavaScript Code
<script type=
"text/javascript"
src=
"http://maps.googleapis.com/maps/api/js?sensor=false&libraries=places"
></script>
<script type=
"text/javascript"
>
google.maps.event.addDomListener(window,
'load'
,
function
() {
var
inputAddressField = document.getElementById(
"txtFullAddress"
);
var
places =
new
google.maps.places.Autocomplete(inputAddressField);
google.maps.event.addListener(places,
'place_changed'
,
function
() {
var
place = places.getPlace();
var
address = place.formatted_address;
var
latitude = place.geometry.location.lat();
var
longitude = place.geometry.location.lng();
var
mesg =
"Address: "
+ address;
mesg +=
"\nLatitude: "
+ latitude;
mesg +=
"\nLongitude: "
+ longitude;
alert(mesg);
});
});
</script>
Reply
Answers (
2
)
Export To Excel - XLWorkbook - Date and Time NumberFormat
auto generate application using model