<?php
defined('PRODUCT_NAME') or die;
class GoogleMap extends ModuleInstance
{
	public function __construct()
	{
		parent::__construct();
		$this->enable_jquery = true;
	}

	function render()
	{
		$this->load->view("modules/googlemap/module",
	                  array("module_instance_id" 	=> $this->module_instance_id,
					  		"title" 				=> $this->setting("title"),
					  		"title_heading_level" 	=> $this->setting("title_heading_level"),
		              		"module_class" 			=> $this->setting("module_class"),
					  		"address" 				=> rawurlencode($this->setting("address")),
	                  		"zoom" 					=> $this->setting("zoom"),
	                  		"latitude" 				=> $this->setting("latitude"),
	                  		"longitude" 			=> $this->setting("longitude"),
	                  		"sv_heading" 			=> $this->setting("sv_heading"),
	                  		"sv_pitch" 				=> $this->setting("sv_pitch"),
	                  		"sv_zoom" 				=> $this->setting("sv_zoom"),
	                  		"initial_view" 			=> $this->setting("initial_view"),
	                  		"style_url" 			=> $this->setting("style_url"),
	                  		"disable_scroll" 		=> $this->setting("disable_scroll"),
	                  		"disable_drag" 			=> $this->setting("disable_drag"),
	                  		"bubble_text" 			=> str_replace(array("\r", "\n", '"'), array("", "", "'"), nl2br($this->setting("bubble_text"))),
	                  		"api_key" 				=> $this->setting("api_key")));
	}
}
