Jump to content

Google Map Marker and Centering Map


Mitrovah

Recommended Posts

So I have code for a google map window. However I am having trouble figuring out how to make a generic google marker appear on my Long and Lat location.

The <div id> tag is at the bottom of the page and I want to figure out how to center it in the page.

 

My second question is how to indent the first line of the first paragraph.

this is my Google Map Code:

<script src="http://maps.googleapis.com/maps/api/js"></script>
    <script>
function initialize() {
  var mapProp = {
    center:new google.maps.LatLng(41.652589,-91.532774),
    zoom:18,
    mapTypeId:google.maps.MapTypeId.ROADMAP
  };
  var map=new google.maps.Map(document.getElementById("googleMap"),mapProp);
}
google.maps.event.addDomListener(window, 'load', initialize);
  var myLatlng = new google.maps.LatLng(41.652589,-91.532774);
  var marker = new google.maps.Marker({
position: myLatlng,
map: map,
});
</script>
 
 
<div id="googleMap" style="width:500px;height:380px;">
Edited by Mitrovah
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...