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
https://forums.phpfreaks.com/topic/121850-solved-google-maps-adding-a-marker/
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>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.