Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear sir/madam,

i try to integrate the google map in my project.but the map is not getting show on the page and i also showing the marker on it.
here is my code:-
<div id="dvMap" style="width: 100%; height:350px;">
                       </div>
                       <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAEYPGjyMXdnZ9Sq2VOyqvf1TLotaBCDx"></script>
                       <script type="text/javascript">
       var markers = @Html.Raw(ViewBag.Markers);
       window.onload = function () {
           var mapOptions = {
               center: new google.maps.LatLng(markers),
               zoom: 15,
               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>

Am getting this error:-
Source map error: request failed with status 404
Resource URL: http://localhost:50649/assets/js/bootstrap-select.min.js
Source Map URL: bootstrap-select.js.map[Learn More]
Source map error: request failed with status 404
Resource URL: http://localhost:50649/assets/js/blueimp-gallery.min.js
Source Map URL: blueimp-gallery.min.js.map[Learn More]


What I have tried:

didn't tried anything other than this
Posted
Comments
phil.o 10-Jun-18 7:13am    
404 means the server responded to the request, but requested resource could not be found.
Specifically, the server on localhost:50649 cannot find the resources under assets/js/ path. This does not seem to have anything to do with the server at maps.googleapis.com.
F-ES Sitecore 10-Jun-18 9:27am    
Make sure the right version of those files is at the location it is trying to find them.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900