Please disregard the 'View article...' shown at the bottom of many posts as this is the result of restoring old forum posts from a backup.

google maps

I have made 2 modules for exponent - concerts and venues. Venues stores locations for concerts including address data and latitude and longitude.(http:\\themastersown.com) My problem is getting the data to google maps v3 to draw the map. I am able to draw a static map with the data. But I can't the map data to work in a smarty template. Any ideas. I am new to forums.


View article...

Comments

  • I've written a custom view for the text module which uses the gmaps.js script http://hpneo.github.com/gmaps/ Is this what you're looking for?

    I've also created a view configuration which allows me to enter the lat/long, zoom, and a lat/long for the marker.

    If you email me @ dleffler@hughes.net, I'll send you the view and the view config file.


    View article...
  • Hey, do you have this custom view working for the latest Exp? I just ran into problems because jquery is referenced LATER, only in the end of the page code and thus the map doesn't work at all.
    I am using the code like

    < script src="js/jquery.gmap.js">< / script>
    < script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false">< / script>

    < ! -- MAP -- >

    < script type="text/javascript">
    $(document).ready(function(){
    $("#map").gMap({ controls: false,
    scrollwheel: false,
    draggable: true,
    markers: [{ latitude: 47.174589,
    longitude: 8.513854,
    icon: { image: "img/pin.png",
    iconsize: [32, 47],
    iconanchor: [32,47],
    infowindowanchor: [12, 0] } }
    ],
    icon: { image: "img/pin.png",
    iconsize: [26, 46],
    iconanchor: [12, 46],
    infowindowanchor: [12, 0] },
    latitude: 47.174589,
    longitude: 8.513854,
    zoom: 9, });
    });
    </ script>



    View article...
  • I have several variations going...in fact in the pre-release for 2.3.2 ('develop' branch of our github repo, planned to be out by Christmas), we have a new {google_map} smarty function to embed a map...however, I digress. You should be able to 'redeem' the above code by changing the opening/ending script tags with a smarty script block like this

    {script unique=gmaps jquery=1}
    {literal}
    $(document)...
    ...
    zoon: 9,}),
    });
    {/literal}
    {/script}

    This will cause your code to be output at the bottom of the page AFTER jquery is loaded.


    View article...
  • Sorry for reviving this old topic. How do I go about embedding the map with the {google_map} smarty function? Is it integrated into a module already or do I have to do more to make this work?
  • {google_map unique="mymap" address="123 Main St, Lanesville, IN 41772"}
    also accepts a 'height' param integer, or defaults to 190px.  'address' could also be an 'address' object id.
Sign In or Register to comment.