Jump to content

[SOLVED] Google maps, adding a marker


fri3ndly

Recommended Posts

Please can someone help me with this? There is no javascript error but the marker is not showing :-(

 

 

    <script type="text/javascript">
    //<![CDATA[
    function load() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
        map.setCenter(new GLatLng(51.518994, -0.133457), 17);
	map.addControl(new GLargeMapControl());
	map.addControl(new GScaleControl());
	map.addControl(new GMapTypeControl());

	var point = new GPoint(parseFloat(51.518994),parseFloat(-0.133457));
	var marker = new GMarker(point);
	map.addOverlay(marker);
      }
    }
    //]]>
    </script>

Link to comment
Share on other sites

Solved:

 

   

<script type="text/javascript">
    //<![CDATA[

    function load() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
        map.addControl(new GSmallMapControl());
        map.addControl(new GMapTypeControl());
        map.setCenter(new GLatLng(51.518994, -0.133457), 17);

        var marker = new GMarker(map.getCenter());

        map.addOverlay(marker);
      }
    }

    //]]>
    </script>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.