Hello,
i'm trying to insert a google map in a form but it don't work.
I'm using joomla 2.5 e chronoforms v4.
My idea is a page like this in html:
it create a simple google map when i click the button.
In chronoforms i use the Form Wizard and i drag a Custom Element from the Advanced Group into the Preview window. I open this action and paste this code there.
in the event tab i insert a Load JS in the on load section and put inside it this code
now where insert this code?
looking in the post i found this:
and i insert inside a cunstom code in the element tab.
It doesn 't work...
where insert this code?
Anybody can help me?
thank you very much
i'm trying to insert a google map in a form but it don't work.
I'm using joomla 2.5 e chronoforms v4.
My idea is a page like this in html:
<!DOCTYPE html>
<html>
<head>
<script
src="http://maps.google.com/maps/api/js?sensor=false">
</script>
<script>
function initialize()
{
var mapOpt = {
center:new google.maps.LatLng(51.508742,-0.120850),
zoom:5,
mapTypeId:google.maps.MapTypeId.ROADMAP
};
var map=new google.maps.Map(document.getElementById("googleMap"),mapOpt);
}
</script>
</head>
<body>
<div id="googleMap" style="width:500px;height:380px;"></div>
<button onclick="initialize()">Click me</button>
</body>
</html>
it create a simple google map when i click the button.
In chronoforms i use the Form Wizard and i drag a Custom Element from the Advanced Group into the Preview window. I open this action and paste this code there.
<div id="googleMap" style="width:500px;height:380px;"></div>
<button onclick="initialize()">Click me</button>
in the event tab i insert a Load JS in the on load section and put inside it this code
function initialize()
{
var mapOpt = {
center:new google.maps.LatLng(51.508742,-0.120850),
zoom:5,
mapTypeId:google.maps.MapTypeId.ROADMAP
};
var map=new google.maps.Map(document.getElementById("googleMap"),mapOpt);
}
now where insert this code?
src="http://maps.google.com/maps/api/js?sensor=false"
looking in the post i found this:
<?php
$doc =& JFactory::getDocument();
$doc->addScript("http://maps.google.com/maps/api/js?sensor=false");
?>
and i insert inside a cunstom code in the element tab.
It doesn 't work...
where insert this code?
Anybody can help me?
thank you very much