views:

21

answers:

1

What are other ways to embed Google maps?

+1  A: 

You may want to use the Google Maps API. It will render in a <div>, as in the following example:

<!DOCTYPE html>
<html> 
<head> 
   <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> 
   <title>Google Maps Basic Demo</title> 
   <script src="http://maps.google.com/maps?file=api&amp;amp;v=2&amp;amp;sensor=false" 
           type="text/javascript"></script> 
</head> 
<body onunload="GUnload()"> 

   <div id="map" style="width: 400px; height: 300px"></div> 

   <script type="text/javascript"> 

   if (GBrowserIsCompatible()) {
      var map = new GMap2(document.getElementById("map"));

      map.setUIToDefault();
      map.setCenter(new GLatLng(39.00, -77.00), 5);
   }
   </script> 
</body> 
</html>

Basig Map example

Daniel Vassallo
What are benefits to use any jquery plugin related to Maps inplace of Google Map's default Iframe code?
metal-gear-solid
Using a jquery plugin may make it easier to implement, but in most cases there is no significant benefit. The Google Maps API already comes with a set of cross-brower methods that you can easily call from JavaScript directly, as in the example above.
Daniel Vassallo
metal-gear-solid
@jitendra: Can you give us a more detailed example of the iframe method that you are using?
Daniel Vassallo
in Iframed maps some times the red bulb not coming up, sometimes white bubble not coming up or not positioned proerly
metal-gear-solid