Google Maps Problem JavaScript API V3 with WebApp in MVC

3

I want to make a simple Map appear when the user clicks (Menu > Find), the problem is that the controller receives the data and sends me and does not return the Map.

I'm using my default MVC project.

  

The code I made available in the application repository .

    
asked by anonymous 15.03.2014 / 01:40

1 answer

3

So, based on the file that is in your GitHub in 'boasaude / assets / js / controllers / MapController.js',

I noticed that on line 17

  

'google.maps.event.addDomListener (window,' load ', initialize);'

To lower the code being I made the following change: I changed line 17 by a function call and it looks like this:

  

"initialize ();"

Note: Why does not it work? the window (window) is already loaded so the initialize of addDomListener did not do the start function.

Even though the map did not appear ... but I noticed that the contents within the map load had changed ...

I made a test putting height and width and changing the code that was in index.html, thus:

<style>
         html, body, #map-canvas {
          /*height: 100%;  Código antigo */
          height: 600px; /* Novo */
          width: 600px; /* Novo */
          margin: 0px;
          padding: 0px
         }
</style>

And then the map popped up.

I hope you have helped.

    
19.03.2014 / 23:40