Introduction:
In this article we will see how to display the Google map using J-query mobile and MVC4. In my last article related to MVC4 I've discussed what is new in MVC4 where we saw that MVC4 supports mobile web-site development using J-query mobile and HTML5. In this article I'm using same j-query mobile and displaying the Google map on the View. So let's start to display the map step-by-step.
Step1:
Create a new project of MVC4 mobile website. Add the Action in home controller and simply return the view.
Step 2:
Now you need to download the J-query Mobile. After downloading j-query mobile, copy the following given scripts and CSS files and paste them into your application directory.
-
query.mobile-1.0.1.min.css
-
jquery.js
-
jquery.mobile-1.0.1.min.js
-
map.js and map.css
Step 3:
Now add the reference to the above listed files (like below) in that for the first three files i.e. jquery.mobile-1.0.0.min.js and css and jquery.js keep in the head section while map.js and css in the body section.
<link href="../../ScriptAndCss/jquery.mobile-1.0.1.min.css" rel="stylesheet"
type="text/css" />
<script src="../../ScriptAndCss/jquery.js" type="text/javascript"></script>
<script src="../../ScriptAndCss/jquery.mobile-1.0.1.min.js" type="text/javascript"></script>
<script src="http://maps.google.com/maps/api/js?sensor=false"></script>

anil babuPosted Sep 26, 2013, 5:35 AM
how to display google reviews in my website using MVC4