Jump to content

Embedded Map in template file failing in new version of Jreviews


Tim

Recommended Posts

Hi,

 

For various reasons I'm adding maps onto some of my override templates by using the following code. It's worked well for a long time. In the latest update the geomaps fail to load on my override template page in this fashion. I noticed how the geomaps.js file has changed to a API at the start of the file. Is this causing my issues?

 

I've clear all my caches and have no javascript errors

 

Thanks

 

Tim

 

 


  <?php
	   
	   		$custom_lat = $CustomFields->field('jr_arealatitude',$listing);
			$custom_lon = $CustomFields->field('jr_arealongitude',$listing);
			if ($custom_lat == "" || $custom_lat == false){
				$custom_lat = $CustomFields->field('jr_latitude',$listing);
				$custom_lon = $CustomFields->field('jr_longitude',$listing);
			}

                               
			$module_params = array(
			'tmpl_suffix'=>'_test',  ///// map_infowindow_test.thtml
			'moduleclass_sfx'=>' _test',
			'cache_map'=>'0',
			'mode'=>'2', 					//'0' Normal (Use filtering settings)|''>Geo Targeting (IP Address to Location)|'2'>Custom center & zoom
			'radius'=>'1500',					//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'=>'6',					//Default zoom level for Geo Targeting and Custom Center modes.  Zoom (0-20+)
			'custom_lat'=>''.$custom_lat.'',				//Used when Custom Center & Zoom option selected.
			'custom_lon'=>''.$custom_lon.'',				//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%')
			'2search_auto'=>'0',		        //|0=No|1=yes  Automatically filters results when in 2search pages using the value from the 2search field.   
			'cat_auto'=>'0',					//Filters results for current category.
			'detail_view'=>'0',				//1'>Show listing marker only  0'>Show all category markers
			'dir'=>'10',						//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'=>'100',		
			'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'=>'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',			        //2|0|1
			'ui_double'=>'',			        //2|0|1
			'ui_trimtitle_module'=>'2',		        //0|1
			'ui_trimtitle_chars'=>'30',		        //

		);                         

			//prx($moduleParams);
			//echo $this->requestAction('module_geomaps/listings/',$moduleParams);	
			$moduleParamsCustom['module'] = $module_params;
			$moduleParamsCustom['module_id'] = 'geomapsCustom_BUOYS_'.$listing['Listing']['listing_id'];
			$moduleParamsCustom['data']['module'] = true;
			$moduleParamsCustom['data']['controller'] = 'module_geomaps';
			$moduleParamsCustom['data']['action'] = 'listings';
			$moduleParamsCustom['token'] = cmsFramework::formIntegrityToken($moduleParamsCustom,array('module','module_id','form','data'),false);
			$DispatcherGeoMap = new S2Dispatcher('jreviews',false);

			$DispatcherGeoMapStore = $DispatcherGeoMap->dispatch($moduleParamsCustom);
			echo($DispatcherGeoMapStore);

		unset($DispatcherGeoMap);

	////////////////////////////////////////////////////  
?>

Link to comment
×
×
  • Create New...