Google maps
Posted: Tue Aug 04, 2009 2:08 am
Hello,
I would like to be able to populate a google map with records from a table called tbl_organisations
I have this working fine in PHP outside of xataface, but I can't get the map (even a basic one without any markers pulled from an php generated XML file.
my actions.ini looks like this:
my map.php file looks like this:
my Map_View.html file without any google maps stuff looks like this:
The google maps code from http://code.google.com/apis/maps/docume ... ction.html looks like this:
I have tried many ways of putting this into Map_View.html without any success.
I would be grateful if someone could show me how the google maps code above can be incorporated into my map tab / Map_View.html
Many thanks, Tom
I would like to be able to populate a google map with records from a table called tbl_organisations
I have this working fine in PHP outside of xataface, but I can't get the map (even a basic one without any markers pulled from an php generated XML file.
my actions.ini looks like this:
- Code: Select all
[map]
label = Map
category = table_tabs
mode = map
url = "{$this->url('-action=map')}"
template = Map_View.html
condition = "$query['-table']=='tbl_organisations'"
my map.php file looks like this:
- Code: Select all
<?php
class actions_map {
function handle(&$params){
df_display(array(), 'Map_View.html');
}
}
?>
my Map_View.html file without any google maps stuff looks like this:
- Code: Select all
{use_macro file="Dataface_Main_Template.html"}
{fill_slot name="main_section"}
Some text
{/fill_slot}
{/use_macro}
The google maps code from http://code.google.com/apis/maps/docume ... ction.html looks like this:
- Code: Select all
<!DOCTYPE html "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Google Maps JavaScript API Example</title>
<script src="http://maps.google.com/maps?file=api&v=2&key=MYGOOGLEMAPSKEY=true_or_false"
type="text/javascript"></script>
<script type="text/javascript">
function initialize() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(37.4419, -122.1419), 13);
map.setUIToDefault();
}
}
</script>
</head>
<body onload="initialize()" onunload="GUnload()">
<div id="map_canvas" style="width: 500px; height: 300px"></div>
</body>
</html>
I have tried many ways of putting this into Map_View.html without any success.
I would be grateful if someone could show me how the google maps code above can be incorporated into my map tab / Map_View.html
Many thanks, Tom