Changing map and marker defaults

Phoca Maps - displaying maps in Joomla! CMS
rob-van-baal
Phoca Member
Phoca Member
Posts: 27
Joined: 14 Jan 2011, 21:15
Location: Netherlands
Contact:

Changing map and marker defaults

Post by rob-van-baal »

I have put many hours in figuring out how to set the parameters for new maps and markers and wrote that down in my Phoca Maps configuraton file. But since I'm sure that I will not remember these settings when I'm working in the admin GUI, I thought of changing the source code according to my desired settings. And so I did!
The values for the variables are easy to find using phpmyadmin on the map and marker table. So if you want to use your own default, just check there.

When I'm adding new maps of markers, everything is now directly as I wanted it. :twisted:

And I also edited the default location/zoomlevel for the maps to the center of NL, so that I do not have to scroll to our small country every time I create a map or a marker. :wink:

Please use this for your own benefit.
The result can be checked on my website: http://www.fischertechnikclub.nl/index. ... 57&lang=nl

The source code file you need to change for MAPS is this one:

Code: Select all

administrator/components/com_phocamaps/models/phocamapsmap.php
I have used these settings:

Code: Select all

	function _initData() {
		if (empty($this->_data)) {
			$table = new stdClass();
			$table->id					= null;
			$table->title				= null;
			$table->alias				= null;
			$table->width				= 600;
			$table->height				= 400;
			$table->latitude			= 52.024809808107115;
			$table->longitude			= 5.672607421875;
			$table->zoom				= 7;	
			$table->lang				= '';
			$table->border				= 3;
			$table->continuouszoom 		= 1;
			$table->doubleclickzoom 	= 1;
			$table->scrollwheelzoom 	= 1;
			$table->zoomcontrol			= 1;
			$table->scalecontrol 		= 0;
			$table->typeid				= 2;
			$table->typecontrol			= 1;
			$table->typecontrolposition	= 3;
			$table->collapsibleoverview = 1;
			$table->dynamiclabel 		= 0;
			$table->googlebar 			= 1;
			$table->displayroute		= 1;
			$table->kmlfile				= null;
			$table->description			= null;
			$table->published			= null;
			$table->checked_out			= null;
			$table->checked_out_time	= null;
			$table->ordering			= null;
			$table->acces				= null;
			$table->hits				= null;
			$table->params				= null;
			$this->_data				= $table;
			return (boolean) $this->_data;
		}
		return true;
	}
The source code file you need to change for MARKERS is this one:

Code: Select all

administrator/components/com_phocamaps/models/phocamapsmarker.php
I have used these settings:

Code: Select all

	function _initData() {
		if (empty($this->_data)) {
			$table = new stdClass();
			$table->id					= null;
			$table->catid				= null;
			$table->title				= null;
			$table->alias				= null;
			$table->latitude			= 52.024809808107115;
			$table->longitude			= 5.672607421875;
			$table->gpslatitude			= null;
			$table->gpslongitude		= null;
			$table->displaygps			= 1;
			$table->icon				= 6;
			$table->description			= null;
			$table->contentwidth		= '';
			$table->contentheight		= '';
			$table->markerwindow		= 0;
			$table->published			= null;
			$table->checked_out			= null;
			$table->checked_out_time	= null;
			$table->ordering			= null;
			$table->acces				= null;
			$table->hits				= null;
			$table->params				= null;
			$this->_data				= $table;
			return (boolean) $this->_data;
		}
		return true;
	}
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Changing map and marker defaults

Post by Jan »

Hi, thank you for this guide.

Jan
If you find Phoca extensions useful, please support the project
Post Reply