Jump to:

10990 Posts in 2727 Topics by 1818 members

All other Modules

SilverStripe Forums » All other Modules » Light weight Google Map implementation to critique

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 823 Views
  • kcd
    Community Member
    54 Posts

    Light weight Google Map implementation to critique Link to this post

    I wanted to implement a single google map for a contact page and this is what I came up with. Any suggestions?


    <% require javascript(http://maps.google.com/maps/api/js?sensor=false) %>
    <% require javascript(mysite/javascript/googlemap.js) %>

    <div id="map_canvas"></div>
    <script type="text/javascript"> initMap(); </script>


    width: 100%;
    height: 350px;


    function initMap() {
    var latlng = new google.maps.LatLng(-41.3,174.8);
    var myOptions = {
    zoom: 5,
    center: latlng,
    mapTypeId: google.maps.MapTypeId.ROADMAP,
    var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

    var marker = new google.maps.Marker({
    position: latlng,
    map: map,
    title:"Roughly Wellington"

    I didn't want to download jQuery or risk conflicts by using window.onload() / body .onload()

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.