Jump to content

[SOLVED] Details Page - Embedded Map v3 Module inside a tab


Tim

Recommended Posts

Hi,

 

The script at the bottom works in a detailed page to embed a map. This however does not work inside a tab. I've narrowed  it down to the line of code that echos the object to the browser.

 

If I put the following line Outside the tab it works

<?php echo $DispatcherGeoMap->dispatch($areaMapmoduleParams); ?>

But then obviously the map is the outside the tab.

 

Has anyone any ideas why this new way of embedding a map doesn't work with tabs? The previous way of

'echo $this->requestAction('module_geomaps/listings/',$moduleParams);' used to work fine.

 

This script works outside a tab only, if it's inside a tab then it never loads and I get a grey box with a spinning graphic.

 

 

<?php                                         
			$module_params = array(
			'tmpl_suffix'=>'',
			'moduleclass_sfx'=>' border3',
			'cache_map'=>'0',
			'mode'=>'2', 					//'0' Normal (Use filtering settings)|''>Geo Targeting (IP Address to Location)|'2'>Custom center & zoom
			'radius'=>'50',					//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'=>'17',					//Default zoom level for Geo Targeting and Custom Center modes.  Zoom (0-20+)
			'custom_lat'=>''.$CustomFields->field('jr_lat',$listing).'',				//Used when Custom Center & Zoom option selected.
			'custom_lon'=>''.$CustomFields->field('jr_long',$listing).'',				//Used when Custom Center & Zoom option selected.
			'search_bar'=>'0',				//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',		        //|0=No|1=yes  Automatically filters results when in click2search pages using the value from the click2search field.   
			'cat_auto'=>'0',					//Filters results for current category.
			'detail_view'=>'0',				//1'>Show listing marker only  0'>Show all category markers
			'dir'=>'',						//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'=>'26,30',					//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'=>'5000',		
			'clustering'=>'0',				         //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'=>'2',			       //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|0|1
			'ui_doubleclick'=>'',			        //2|0|1
			'ui_trimtitle_module'=>'',		        //0|1
			'ui_trimtitle_chars'=>'',		        //

		);
		//prx($moduleParams);
		//echo $this->requestAction('module_geomaps/listings/',$moduleParams);	
		$moduleParams['module'] = $module_params;
		$moduleParams['module_id'] = 'geomaps'.$listing['Listing']['listing_id'];
		$moduleParams['data']['module'] = true;
		$moduleParams['data']['controller'] = 'module_geomaps';
		$moduleParams['data']['action'] = 'listings';
		$moduleParams['token'] = cmsFramework::formIntegrityToken($moduleParams,array('module','module_id','form','data'),false);
		$Dispatcher = new S2Dispatcher('jreviews',false);
                       /// THIS ONLY WORKS OUTSIDE A TAB
		echo $Dispatcher->dispatch($moduleParams);                        
		unset($Dispatcher);	
                       ////////////////////////////
		?>

Link to comment
×
×
  • Create New...