Jump to content

[SOLVED] Embedding a map module into detail listings page with Map API v3


Tim

Recommended Posts

Hi,

 

As I needed custom JReview variables to update position, radius and zoom live on to the page I've embedded the following code into a listings detail.thtml page. It worked really well until I upgraded jReviews with the Map API v3. Obviously this hack no longer worked.

 

Please can you give me some pointers of hpw it may look with maps V3 or where I can find out thenew info. I original got this from your forum.

 

Thanks  

 

Tim

 

original post : http://www.reviewsforjoomla.com/forum/index.php?topic=12609

 

 

<!--  BEGIN MAP -->

<?php                                        

$moduleParams = array(

'module_id'=>'geomaps'.$listing['Listing']['listing_id'],

'module'=>array(

'tmpl_suffix'=>'_naturearea',

'moduleclass_sfx'=>'_naturearea',

'cache_map'=>'',

'mode'=>'2', //'0' Normal (Use filtering settings)|''>Geo Targeting (IP Address to Location)|'2'>Custom center & zoom

'radius'=>'10', //Defines the radius for listings lookup around the center found via Geo Targeting or Custom Center modes. Will use Miles or Km based on the GeoMaps configuration. If left blank all listings in the database are added to the map which can affect site performance if there are thousands of markers.

'zoom'=>''.$CustomFields->field('jr_natureareazoomlevel',$listing,false,false), //Default zoom level for Geo Targeting and Custom Center modes.  Zoom (0-20+)

'custom_lat'=>''.$CustomFields->field('jr_arealatitude',$listing,false,false), //Used when Custom Center & Zoom option selected.

'custom_lon'=>''.$CustomFields->field('jr_arealongitude',$listing,false,false), //Used when Custom Center & Zoom option selected.

'search_bar'=>'', //Allows users to quickly find a location on the map

'filter'=>'none',        //Shows only featured listings on the map - |none|featured|

'custom_where'=>'', //Custom WHERE' description='Custom WHERE for query. Example: (Field.jr_brand LIKE '%Agfa%' OR Field.jr_brand LIKE '%Canon%')

'click2search_auto'=>'',        //|0=No|1=yes  Automatically filters results when in click2search pages using the value from the click2search field.  

'cat_auto'=>'', //Filters results for current category.

'detail_view'=>'', //1'>Show listing marker only  0'>Show all category markers

'dir'=>'3,1,4,2', //Comma separated list, no spaces. To filter by IDs only one of the id parameters needs to be filled in.

'section'=>'', //Comma separated list, no spaces. To filter by IDs only one of the id parameters needs to be filled in

'category'=>'', //Comma separated list, no spaces. To filter by IDs only one of the id parameters needs to be filled in

'listing'=>'', //Comma separated list, no spaces. To filter by IDs only one of the id parameters needs to be filled in

'map_width'=>'100%', //Remember to include px or %. For example 100% or 500px

'map_height'=>'400px', //Remember to include px or %. For example 100% or 500px

'custom_fields'=>'',        //Comma separated list, no spaces. To improve performance you need to specify exactly which fields you will be showing in the marker tooltips and modify the /geomaps/map_infowindow.thtml

'limit_results'=>'',

'clustering'=>'',         //0=no | 1=yes  Groups markers at high zoom levels. Must be used when showing a large number of markers for performance gains.

'clustering_min_markers'=>'',          //When clustering is enabled, any number of markers above this setting will trigger the marker clustering functionality.

'ui_maptype'=>'2', // 2='Global'|buttons='Buttons'|menu='Menu'|none='None'

'ui_map'=>'2', //2='Global|0='No'|1='yes'

'ui_hybrid'=>'2',        //2|0|1

'ui_satellite'=>'2',        //2|0|1

'ui_terrain'=>'2',         //2|0|1

'ui_maptype_def'=>'G_HYBRID_MAP',       //2='Global'|G_NORMAL_MAP'|G_SATELLITE_MAP|G_HYBRID_MAP|G_PHYSICAL_MAP

'ui_panzoom'=>'2', //2|0|1

'ui_scale'=>'2', //2|0|1

'ui_scrollwheel'=>'2',        //2|0|1

'ui_doubleclick'=>'',        //2|0|1

'ui_trimtitle_module'=>'2',        //0|1

'ui_trimtitle_chars'=>'30',        //

 

)

);

echo $listing['Listing']['jr_arealatitude'];

echo $listing['Listing']['jr_arealongitude'];

 

echo $this->requestAction('module_geomaps/listings/',$moduleParams);

?>

 

 

<!--  END MAP -->

Link to comment
×
×
  • Create New...