Solved

Google map insert in a contact page

Posted on 2010-11-16
6
562 Views
Last Modified: 2012-05-10
I have seen contact pages where a Google map is a simple picture that is static and irresponsive to the mouse. Is it possible to insert a live Google map in a rectangular box on which user can drag, move and resize the map?
Please instruct how and provide sample code.
Thanks a lot.
0
Comment
Question by:ksfok
6 Comments
 
LVL 15

Accepted Solution

by:
jorge_toriz earned 167 total points
ID: 34152336
Go to maps.google.com, click on "Link" hyperlink, copy the "Paste HTML to embed in website" code on your HTML source... that's all
0
 
LVL 21

Expert Comment

by:Alpesh Patel
ID: 34153618
yes, we can do it. Please see radhesoftech.com/contactus.aspx

Just register on google and use that Javascript on page to get the dynamic googlemap on your page.
0
 
LVL 3

Assisted Solution

by:manlimnag
manlimnag earned 166 total points
ID: 34154496
The javascript API for google maps are their also you can find some commercial controls who wrapped this functionality in simplified way if you wish But in most cases Google API is more than enough.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:ksfok
ID: 34157255
Is Google API something we have to pay for?
0
 

Author Comment

by:ksfok
ID: 34298713
PatelAlpesh,
See error generated by radhesoftech.com/contactus.aspx beow:

Server Error in '/' Application.
--------------------------------------------------------------------------------

The remote name could not be resolved: 'mail.radheinfotech.com'
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.WebException: The remote name could not be resolved: 'mail.radheinfotech.com'

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace:


[WebException: The remote name could not be resolved: 'mail.radheinfotech.com']
   System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout) +5483819
   System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback) +202
   System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback) +21
   System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) +332
   System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) +160
   System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) +159
   System.Net.Mail.SmtpClient.GetConnection() +35
   System.Net.Mail.SmtpClient.Send(MailMessage message) +1213

[SmtpException: Failure sending mail.]
   System.Net.Mail.SmtpClient.Send(MailMessage message) +1531
   UserRegistration.createUserWizard_CreatedUser(Object sender, EventArgs e) +490
   System.Web.UI.WebControls.CreateUserWizard.OnCreatedUser(EventArgs e) +111
   System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser() +354
   System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs e) +102
   System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e) +418
   System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent(Object source, EventArgs e) +161
   System.Web.UI.WebControls.WizardChildTable.OnBubbleEvent(Object source, EventArgs args) +19
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +118
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +166
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3615; ASP.NET Version:2.0.50727.3614
0
 
LVL 1

Assisted Solution

by:saranoerr
saranoerr earned 167 total points
ID: 34348161
First you must include the following Javascript file.  You may have to supply a different "key" parameter for your website.  You can get a key here: http://code.google.com/apis/maps/signup.html
 
You can place the div with id "map_canvas" anywhere on your web page.  You can also make the map more interactive and default to a specific location by supplying different lat/lon on initialization. To zoom to a specific level the map you can call map.setZoom([insert num between 2-21])

See below:

<!DOCTYPE html "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Google Maps JavaScript API Example</title>
    <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=abcdefg&sensor=true_or_false"
            type="text/javascript"></script>
    <script type="text/javascript">

    function initialize() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(37.4419, -122.1419), 13);
        map.setUIToDefault();
      }
    }

    </script>
  </head>
  <body onload="initialize()" onunload="GUnload()">
    <div id="map_canvas" style="width: 500px; height: 300px"></div>
  </body>
</html>
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Using in-flight Wi-Fi when you travel? Business travelers beware! In-flight Wi-Fi networks could rip the door right off your digital privacy portal. That’s no joke either, as it might also provide a convenient entrance for bad threat actors.
This Micro Tutorial will show you how to maximize your wireless card to its maximum capability. This will be demonstrated using Intel(R) Centrino(R) Wireless-N 2230 wireless card on Windows 8 operating system.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now