This example shows how to render Googlemap control for Asp.Net MVC using an Ajax call.
Click on the button above to load the map
Notice that to avoid including the google map script multiples time, you should include the jmelosegui.googlemap.js script
@(Html.GoogleMap() .ScriptRegistrar(scripts => scripts.Add("jmelosegui.googlemap.js")) )
and then pass the map container id and the ajax funtion to make the ajax call
new jmelosegui.instance.GoogleMap('#mapContainer').ajax({ url: '@Url.Action("GooglemapPartialView", "Basic")', type: "Get", data: { payload: 'from ajax call'}, success: function(data) { alert('succeded'); } });
This way the jmelosegui.googlemap.js script will track the inclusion of the google maps scripts for you.
The Http methods supported are "Get" and "Post"
For a complete sample click on the Tab "View"