Geocode on multi viewer

8 posts by 4 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: May 30, 2011   (RSS)

By Mikey - February 21, 2011 - edited: February 21, 2011

Is it possible to get the geocode add-on to work on a multi viewer page. Example: I need to create a multi listing page of property listings and each property will need it's very own map display on the listing page, next to the property description. The multi page will displays 5 properties per page, where the site visitor would then click next to see the following 5 properties - each with it's very own map.

Thanks for any help,
Zick

Re: [zick] Geocode on multi viewer

By Jason - February 21, 2011

Hi Zick,

Yes, this is possible, but if you're producing one separate map using javascript for each record, it can start to get really slow. A quick work around that would be quicker would be to use an iframe for each record that embeds a google map. You can do this with the latitude and longitude fields created by the plugin. Here's an example of what it would look like:

<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?ll=<?php echo $record['latitude'];?>,<?php echo $record['longitude'];?>;output=embed"></iframe><br />

Hope this helps get you started.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [zick] Geocode on multi viewer

By Jason - February 22, 2011

Hi Zick,

You shouldn't need an API key. Could you show me a url where you tried this so I can take a look?

To use the javascript from the example code, you'd need to put the javascript that produces a single map in a foreach loop that would output that block of code for each record you returned.

You'd also need to make sure that you where giving each map a unique id.

Hope this helps get you started.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [zick] Geocode on multi viewer

Hey Zick.

Not sure if this helps (my brain's going a bit slow today) but have a look at http://www.ragatzdeanconsulting.com/index2.php

This is using a jQuery plugin, and the Geo plugin and works a treat. More about that here http://www.interactivetools.com/iforum/gforum.cgi?post=84402
Cheers,

Tim (toledoh.com.au)

Re: [Jason] Geocode on multi viewer

By Codee - May 28, 2011

Hi Jason,
I am using the geocoder on a page that will have other javascript that interrupts the geocoder-generated google map code:
<!-- STEP3: Map with single address: Put this where you want your map displayed, rename $record if needed -->


<?php if (@$record['latitude']): ?>
<div id="map_canvas" style="width: 299px; height: 299px; float: left; margin: 0px 15px;"></div>
<?php endif ?>

<?php if (!@$record['latitude']): ?>
<div style="width: 299px; height: 299px; float: left; margin: 0px 15px; border: 1px solid #000;">
<div style="text-align: center; padding-top: 135px">
No map available!
</div>
</div>
<?php endif ?>
<!-- STEP3: /Map with single address -->


How would I embed this in an iframe? The string you provided in this thread generates a generic google map of the west coast of the US.
Thanks!

Re: [equinox69] Geocode on multi viewer

By Jason - May 30, 2011

Hi,

You can create a new .php page that only displays your map. Once you have that working the way you want to, you can include that page as an iframe in your main page.

Hope that helps get you started.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Geocode on multi viewer

By Codee - May 30, 2011

That makes sense!...and I DO have it working on the separate page. Have a great holiday!