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
Guest User
Tech Writer
2.1k
474.2k
Uncaught syntax error handle?
Mar 10 2020 4:06 AM
Hi Team
I am using Google Maps API using Javascript, some how my app is throwing this error 'Uncaught Syntax error handle. Could i be missing some javascript libraries to this view, please advice me and help mates.
@{
ViewBag.Title =
"GoogleMaps"
;
Layout =
null
;
}
<!DOCYTPE html>
<html>
<head>
<meta name=
"viewport"
content=
"width=device-width"
/>
<title>eNtsa Office Location</title>
</head>
<body>
<div id=
"dvMap"
style=
"width: 500px; height: 500px"
>
</div>
<script type=
"text/javascript"
src=
"https://maps.googleapis.com/maps/api/js?key=AIz***"
></script>
<script type=
"text/javascript"
>
var
markers = @Html.Raw(ViewBag.Markers);
// Uncaught syntax error handled
window.onload =
function
() {
var
mapOptions = {
center:
new
google.maps.LatLng(markers[0].lat, markers[0].lng),
zoom: 8,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var
infoWindow =
new
google.maps.InfoWindow();
var
map =
new
google.maps.Map(document.getElementById(
"dvMap"
), mapOptions);
for
(i = 0; i < markers.length; i++) {
var
data = markers[i]
var
myLatlng =
new
google.maps.LatLng(data.lat, data.lng);
var
marker =
new
google.maps.Marker({
position: myLatlng,
map: map,
title: data.title
});
(
function
(marker, data) {
google.maps.event.addListener(marker,
"click"
,
function
(e) {
infoWindow.setContent(data.description);
infoWindow.open(map, marker);
});
})(marker, data);
}
}
</script>
</body>
</html>
Reply
Answers (
11
)
Scaffold-DbContext:Exception calling Start with 1 arguments
Google maps show current location and state?