1. include this script in header section
<script type="text/javascript">
    var icon = new google.maps.MarkerImage("
http://maps.google.com/mapfiles/ms/micons/blue.png";,
    new google.maps.Size(32, 32), new google.maps.Point(0, 0),
    new google.maps.Point(16, 32));
    var center = null;
    var map = null;
    var currentPopup;
    var bounds = new google.maps.LatLngBounds();

    function addMarker(lat, lng, info) {
        var pt = new google.maps.LatLng(lat,lng);
        bounds.extend(pt);
        var marker = new google.maps.Marker({
               position: pt,
       icon: icon,
       map: map
  });

var popup = new google.maps.InfoWindow({
       content:info,
       maxWidth: 200
});

google.maps.event.addListener(marker, "click", function() {
    if (currentPopup != null) {
        currentPopup.close();
                currentPopup = null;
            }
    popup.open(map, marker);
    currentPopup = popup;
});

google.maps.event.addListener(popup, "closeclick", function() {
});

    }

    function initMap(lat,lng) {
map = new google.maps.Map(document.getElementById("map"), {
center: new google.maps.LatLng(0, 0),
  zoom: 14,
        mapTypeId: google.maps.MapTypeId.ROADMAP,
mapTypeControl: false,
        mapTypeControlOptions: {
            style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR
        },
        navigationControl: true,
navigationControlOptions: {
    style: google.maps.NavigationControlStyle.SMALL
        }
    });
        //DISPLAY VAR FROM PHP SCRIPT OR DIRECT LAT, LONG AND THEN CONTENT
TO DISPLAY IN //INFOWINDOW
    addMarker('<?php echo $lat; ?>', '<?php echo $long; ?>','<?php echo
$address; ?>');
    map.setCenter(bounds.getCenter());
}
</script>

2. write this code where u want to show ur map
<div id="map"></div>

3. Include #map { width: 200px; height: 200px; border: 0px; padding: 0px; }
IN STYLESHEET

On Tue, Jul 31, 2012 at 4:57 PM, raj kumar pustela <[email protected]>wrote:

> hi all,
>       how to create google map through lat and lang.
> if any one know please help me.
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Google Maps API V2" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-maps-api/-/IKlC0Du4WpAJ.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-maps-api?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API V2" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=en.

Reply via email to