Support Forums

More questions...Google maps

This is a discussion on More questions...Google maps within the Templates, HTML, CSS, and Design Help forums, part of the General category; Ok I have been searching far and wide for a simple solution, but no luck as yet. I am looking ...


Go Back   68 Classifieds Forums > General > Templates, HTML, CSS, and Design Help

Reply
 
Thread Tools Display Modes
Old 05-10-2010, 03:18 PM   #1
Customer
 
Join Date: May 2010
Posts: 9
Rep Power: 0
ThinkBusiness is on a distinguished road
Default More questions...Google maps

Ok I have been searching far and wide for a simple solution, but no luck as yet.

I am looking for a simple way to integrate a google map using the postcode from a listing. I have seen one google maps module but that seems to have little support and the other one by Larry looks great but not really what I need as it is only required for one section and map generated from a postcode entered in the extra fields.

I just need to integrate a google map from the input post code in the listing using the proper API, I have looked really hard for a solution but the best I have done is:

<iframe width="WIDTH" height="HEIGHT" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.co.uk/maps?f=q&source=s_q&hl=en&geocode=& ;q={get_extra_field id=$view fid=11}&ie=UTF8&output=embed"></iframe>

By putting this into the template (where fid=11 is the postcode) I can display an embedded map from google but it is not 100% accurate and users can click away from the listing.

I think a better solution would be to use the API but that uses javascript and it causes problems in SMARTY.

Is there any simple way to generate an API map?
Can we somehow integrate the normal javascript google map easily from the API key?

I have found this but cannot get it to work:


<?php
require('Smarty.class.php');
require('GoogleMapAPI.class.php');

$smarty = new Smarty();
$map = new GoogleMapAPI();

// setup database for geocode caching
$map->setDSN('mysql://USER:PASS@localhost/GEOCODES');
// enter YOUR Google Map Key
$map->setAPIKey('YOURGOOGLEMAPKEY');

// create some map markers
$map->addMarkerByAddress('621 N 48th St # 6 Lincoln NE 68502','PJ Pizza','<b>PJ Pizza</b>');
$map->addMarkerByAddress('826 P St Lincoln NE 68502','Old Chicago','<b>Old Chicago</b>');
$map->addMarkerByAddress('3457 Holdrege St Lincoln NE 68502',"Valentino's","<b>Valentino's</b>");

// assign Smarty variables;

$smarty->assign('google_map_header',$map->getHeaderJS());
$smarty->assign('google_map_js',$map->getMapJS());
$smarty->assign('google_map_sidebar',$map->getSidebar());
$smarty->assign('google_map',$map->getMap());

// display the template
$smarty->display('index.tpl');
?>

contents of index.tpl:
----------------------

<!DOCTYPE html PUBLIC "-//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" xmlns:v="urn:schemas-microsoft-com:vml">
<head>
{$google_map_header}
{$google_map_js}
<!-- necessary for google maps polyline drawing in IE -->
<style type="text/css">
v\:* {ldelim}
behavior:url(#default#VML);
{rdelim}
</style>
</head>
<body onload="onLoad()">
<table>
<tr>
<td>{$google_map}</td>
<td>{$google_map_sidebar}</td>
</tr>
</table>
</body>
</html>

Thanks everyone!!
__________________
ThinkBusiness on Twitter

Last edited by ThinkBusiness; 05-10-2010 at 03:21 PM.
ThinkBusiness is offline   Reply With Quote
Old 06-04-2010, 11:37 PM   #2
Customer
 
Join Date: Feb 2010
Posts: 9
Rep Power: 0
jnas is on a distinguished road
Default

I am also looking for something similar, I am willing to pay for a module with a google map such as you discussed,
plus I need a map for carpooling to show start and end, and also add a address that shows that point and another address that shows the other point on the map.

Please, some one that has the abbility to do this, I will pay for it.

Please help.

Thanks
J
jnas is offline   Reply With Quote
Reply

Tags
google map

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Google maps plugin problem GaryGrant Techconnx 4 03-02-2010 04:30 PM
Google Maps Module for V3 & V4 Lhotch Modules / Plugins / Modifications 18 09-29-2008 08:05 AM
Google Maps URL to use {$city} bowers01 Technical Support 1 08-07-2008 07:01 AM


All times are GMT -4. The time now is 06:58 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2011, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0