Google Maps inside custom PODS page

Posted by Sharath on Stack Overflow See other posts from Stack Overflow or by Sharath
Published on 2010-06-12T18:17:03Z Indexed on 2010/06/12 18:23 UTC
Read the original article Hit count: 288

Filed under:
|
|

I have a custom pods page called addstory.php which uses a public form to display some input fields. For one of the fields, i have a input helper that displays a google map location which I can use to pick out a location which is stored in comma separated variable. Here is the input helper code...

<div class="form pick <?php echo $location; ?>">
<div id="map" style="width:500; height:500">
</div>
<script type="text/javascript">     
$(function() {
map=new GMap(document.getElementById("map"));

                map.centerAndZoom(new GPoint(77.595062,13.043359),6);

                map.setUIToDefault();


                GEvent.addListener(map,"click",function(overlay,latlng) {

                    map.clearOverlays();
                    var marker = new GMarker(latlng);
                    map.addOverlay(marker);
                    //Extra stuff here..
                }
                );

});

</script>
</div>

And this is the code inside my addstory.php

<?php
get_header();
    $rw = new Pod('rainwater');
    $fields=array(
        'name',
        'email',
        'location'=>array('input_helper'=>'gmap_location'),
    );
    echo $rw->publicForm($fields);
?>

I get the following error...and the google map doesn't load.

a is null
error source line: [Break on this error] function Qd(a){for(var b;b=a.firstChild;){Rg(b);a.removeChild(b)}} 

© Stack Overflow or respective owner

Related posts about Wordpress

Related posts about googlemaps