What are other ways to embed Google maps?
views:
21answers:
1
+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;v=2&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>
Daniel Vassallo
2010-03-03 12:54:30
What are benefits to use any jquery plugin related to Maps inplace of Google Map's default Iframe code?
metal-gear-solid
2010-03-03 12:57:46
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
2010-03-03 13:14:48
metal-gear-solid
2010-03-03 13:18:14
@jitendra: Can you give us a more detailed example of the iframe method that you are using?
Daniel Vassallo
2010-03-03 13:19:29
in Iframed maps some times the red bulb not coming up, sometimes white bubble not coming up or not positioned proerly
metal-gear-solid
2010-03-03 13:41:56