.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Google Maps Tutorial

Posted By: Syed Shakeer Hussain     Posted Date: September 02, 2010    Points: 2   Category :Others
Because it's best to learn from examples, here is a complete listing of all the functionalities GoogleMaps.Subgurim.NET offers .

Each example is made up of an explanation of the element, a map example, and the code corresponding to that example.
Periodically we will be adding to the list!

View Complete Post

More Related Resource Links

Image gallery with EXIF and Google maps?


I am trying to put together an image gallery display. I am guessing it will need to be a customer control but I am not sure.  So I figured I would ask on the best way to approach this. When the gallery is loaded I want to have one image displayed with thumbs underneath. On the right side I would like to display EXIF data and underneath that a small google map if there is geolocation tagged with the picture. I figure I will probably need to store the gallery info in a database with caption and description.  Maybe even searchable tags if I get cheeky later. 

So should I be using an ajax gallery to display the images and if so how to pass the EXIF and geolocation to the other controls? Or do i pull in all the info into some sort of dataset and then parse it out to a custom control.  I am still fairly new to ASP but I have a fairly good understanding.  Should be an intersting project if nothing else.  Any thoughts.


How to display Polygons from sql server 2008 on top of google maps

hi every one,This is the situation I am facing...I have a table in sql server 2008 database that contains map of a village in the form of polygons. I want these polygons to be displayed on top of google maps. Can any body suggest how to start of ?? Thanks in advanceRk

adding onload event from code behind for Google Maps

Im working with Google maps start turoail: http://code.google.com/apis/maps/documentation/javascript/tutorial.html#HelloWorldAs you can see there's a line: <body onload="initialize()">Now since, I want to have Google Maps on page A.aspx within a masterpage main.master, I dont have the <body> tag available to me in the A.aspx page.I preferably DONT want to have the body tag as runat="server", since Google Maps is not relevant for all pages and I dont like a server control when its not needed as they slow things down (even a bit).I tried this in A.aspx.vb, but it didnt work:Dim javaScript As New StringBuilder        javaScript.Append("<script type='text/javascript'>")        javaScript.Append("window.document.body.onload = initialize();")        javaScript.Append("</script>")        Me.Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "BodyLoadUnloadScript", javaScript.ToString())How can I add the onload event from code behind?

XPath expression not working for Google Maps return XML

I have this XMLdocument:<kml><Response><name>3051,netherlands</name><Status><code>200</code><request>geocode</request></Status><Placemark id="p1"><address>3051 Rotterdam, The Netherlands</address><AddressDetails Accuracy="5"><Country><CountryNameCode>NL</CountryNameCode><CountryName>Nederland</CountryName><AdministrativeArea><AdministrativeAreaName>Zuid-Holland</AdministrativeAreaName><Locality><LocalityName>Rotterdam</LocalityName><PostalCode><PostalCodeNumber>3051</PostalCodeNumber></PostalCode></Locality></AdministrativeArea></Country></AddressDetails><ExtendedData><LatLonBox north="51.9497984" south="51.9402954" east="4.4907255" west="4.4656367"/></ExtendedData><Point><coordinates>4.4767883,51.9458650,0</coordinates></Point></Placemark></Response></kml>I used this site: http://www.xmlme.com/XpathTool.aspxwhere I enter the expression: "kml/Response/Placemark/Point/coordinates"I then get the right value. HOWEVER, when I place this code in .NET, the xpath expression returns nothing:req = HttpWebRequest.Create("http://maps.google.com/maps/geo?output=x

google maps


<script type="text/javascript">

     function showLocation() {
         geocoder.getLocations(document.forms[0].address1.value, function (response) {
             if (!response || response.Status.code != 200) {
                 alert("Sorry, we were unable to geocode the first address");
             else {
                 location1 = { lat: response.Placemark[0].Point.coordinates[1], lon: response.Placemark[0].Point.coordinates[0], address: response.Placemark[0].address };
                 geocoder.getLocations(document.forms[0].address2.value, function (response) {
                     if (!response || response.Status.code != 200) {
                         alert("Sorry, we were unable to geocode the second address");
                     else {
                         location2 = { lat: response.Placemark[0].Point.coordinates[1], lon: response.Placemark[0].Point.coordinates[0], address: response.Placemark[0].address };

     function calculateDistance() {
         try {
             var glatlng1 = new GLatLng(location1.lat, location1.lon);
             var glatlng2 = new GLatLng(location2.lat, location2.lon);
             var miledistance = gl

How can I use xml SelectNodes to parse google maps xml ?

I'd like to parse 

I can't find any example on the net which uses

XmlNodeList nodes = doc.SelectNodes("/GeocodeResponse/result/geometry/location/lat/");

Dynamic Google Maps Help


This works fine for me!


"if(GBrowserIsCompatible()) {" & vbLf & vbTab & vbTab & "function ShowMap() {" & vbLf & vbTab & vbTab & vbTab & "var map = new GMap(document.getElementById(""map"")); map.setMapType(G_PHYSICAL_MAP ); " & vbLf & vbLf & vbTab & vbTab & vbTab)


But I'm DYING on adding this line...



Hosting Google Maps in a Microsoft WPF application using XAML

With the Google Maps API for Flash, it is now very easy to add Google Maps technology to your Microsoft Windows Presentation Foundation (WPF) application using XAML.

The Google Maps API for Flash runs as a Flash application inside the Flash player control. The Flash Player control is embedded in the WPF application and code glue allows your Native .NET C# or VB.NET code to interface for the Google Maps control in Flash.

This sample project demonstrates you how to insert Google Maps in your WPF application, how to access the Google Maps API and interface with the Maps control, and how to receive information back from the control in the WPF application.

The final application looks like this:

Google Maps API with Gridview


I am attempting to create an ASP.NET website that incorporates Google Maps to geocode the location of bus stops that the user selects from a gridview that is bound to a SQL database.  Any ideas on how to use a buttonfield to pass the address (text) for a given row to a command that will geocode that address and place a marker on the map?

Reading XML data from Google GeoCode (Maps) Service v3


Google Maps API has upgraded their geocoding service. The old style had each data element in a unique node, so I was reading each node using SelectSingleNode. Now, the node names are all the same, so my VB.net program is not working accurately, except on the lat/long parameters because those are still unique.

Here is the link to an address and how the API responds: http://maps.googleapis.com/maps/api/geocode/xml?address=1210%20cassat%20av,%20jacksonville,%20fl,%20USA&sensor=true


and here is my code:

Dim uriRequest As New Uri(GoogleMapsAPI_URL & _address & _output)
            Dim geoRequest As HttpWebRequest = WebRequest.Create(uriRequest)
            Dim geoResponse As HttpWebResponse = geoRequest.GetResponse()
            Dim sr As New StreamReader(geoResponse.GetResponseStream(), Encoding.UTF8)
            'instantiate new xml document to hold the google geo resulting xml
            Dim geoXml As New XmlDocument()


            'Dim TitleNode As XmlNodeList = geoXml.GetElementsByTagName("address_component")

            'Get County (administrative_area_level_2)

            _GeoCounty = geoXml.Item("/GeocodeResponse/result/address_component/[type=administrative_area_level_2]")

            _GeoCountyData = _GeoCounty.InnerXml.ToString()


Google Maps Marker



As main project this schoolyear I'm making a mobile website, I already imported a Google Map with all the locations in my database.

The problem is when a person visits the LocationDetail.aspx page, he can go to the map but the marker of that location isn't different from the other markers. I want it to be in another color so the visitor can see where the location is.

Somebody an idea?

get the apikey for google maps automatically

i want to get the API key for google maps automatically whenever i install my application on server

SQL Injection Walkthrough / Tutorial

SQL Injection is a trick to inject SQL query/command as an input possibly via web pages. Many web pages take parameters from web user, and make SQL query to the database. Take for instance when a user login, web page that user name and password and make SQL query to the database to check if a user has valid name and password. With SQL Injection, it is possible for us to send crafted user name and/or password field that will change the SQL query and thus grant us something else.

SharePoint Tutorial - Web Parts

A page in SharePoint is comprised of web parts the exist within zones. Web parts are available for just about everything. For example in the page below there are four web part highlighted by different colors. The purple web part displays a short list of the new announcements stored in the annoucements library. The pink web part displays events from a calendar within the site. The green web part displays an image from a location the user specifies. The gray web part displays a list of links from the links list on the site.

SharePoint Tutorial - Team Sites

Team sites are small web sites that are created to store everything about a particular thing. For example a site can be created for a department in an organization like human resources. I site can be created for a particular project. A site can even be created for a meeting. Everything about the thing (department, project, meeting) like documents, lists, calendars, etc. is stored in that site.

SharePoint Tutorial - Libraries

A library is a feature in SharePoint that stores files (documents). Think of a library as a folder on your file system. For example, a library can be created to store resumes in the human resources team site. A library is usually created for a specific type of file. Libraries can contain metadata to describe the particular file in more detail and to make it easier to find.

SharePoint Tutorial - Lists

A list is a feature in SharePoint that stores a lists of information. For example, a list can be created to store web links in the human resources team site. A list is usually created for a specific type of information. Lists can contain metadata to describe the particular information in more detail and to make it easier to find.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend