Google API Do not show up on my page

0

Hello, I'm trying to insert google maps into a MVC site that Visual Studio 2012 already makes available for testing. By taking only the maps part and putting it in a aspx , it generates the cute map the way I need it but when I play it on a div within the "contact" page or any other page MVC it does not pops up. Can anyone explain me why or what I have to do for this map to appear in div certinha.

  Inherits="Contact"%
asked by anonymous 18.07.2017 / 14:28

1 answer

0

the element defined here as map-canvas

map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions);

is not defined anywhere in your view. Also, it does not seem like the initialize method is being called anywhere.

If this is not a problem, put all the contents of the initialize method into

$(document).ready(function(){});

because this will run whenever the view finishes loading;)

    
18.07.2017 / 15:12