Automatic Setup of document.ready = bad

Jan 3, 2010 at 1:06 AM

Hello,

Great control. I am calling your map by jquery.get() and assign the contents to a div. Due to the map having a document.ready() function, it is conflicting with other present jquery code and renders the whole page useless. The content i get by ajax is the following after the Ajax.GoogleMap().CssClass("GoogleMap").Render(); in the usercontrol has been called:

<div id="divG4158336" class="GoogleMap"></div><script type='text/javascript' src='/WebResource.axd?d=rgm3O6ZOAFRTPnYXcBL7BZMf7PKdndsbCMbyc33Gins1&t=633980535391370000'></script>
<script type='text/javascript' src='http://maps.google.com/maps?file=api&v=2&key=abcdefg&sensor=false'></script>
<script type='text/javascript' src='/WebResource.axd?d=rgm3O6ZOAFRTPnYXcBL7BbNjHCL588M7IBh7laWKeqs1&t=633980535391370000'></script>
<script type='text/javascript'>
var G4158336 = null;$(function(){G4158336=new MvcMaps.GoogleMap('divG4158336',{id:'G4158336',lat:39.9097362345372,lng:-97.470703125,zoom:4,maptype:G_NORMAL_MAP});});</script>

How last line to the function:

var G4158336 = new MvcMaps.GoogleMap('divG4158336',{id:'G4158336',lat:39.9097362345372,lng:-97.470703125,zoom:4,maptype:G_NORMAL_MAP});

My post is also here.

Jan 24, 2010 at 1:36 PM

I think you should create a ticket in Issue Tracker with this problem. I have the same problem when I create a new project but strangely, the example works fine.