Skip to content
This repository has been archived by the owner on Nov 8, 2018. It is now read-only.

T6 Changes to Map Indicators #13

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion application/config/map.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Values from 1 to 10
* Default: 4
*/
$config['marker_radius'] = "4";
$config['marker_radius'] = "2.5";


/**
Expand Down
18 changes: 17 additions & 1 deletion application/controllers/json.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ protected function geojson($type)

// Category ID
$category_id = (isset($_GET['c']) AND intval($_GET['c']) > 0) ? intval($_GET['c']) : 0;

// Get the category colour
if (Category_Model::is_valid_category($category_id))
{
Expand Down Expand Up @@ -226,7 +227,7 @@ protected function markers_geojson($incidents, $category_id, $color, $icon, $inc
$link = Incident_Model::get_url($marker);
}
$item_name = $this->get_title($marker->incident_title, $link);

if ($category_id == 0) { $color=$this->get_color($category_id); } else { $color=$color;}
$json_item = array();
$json_item['type'] = 'Feature';
$json_item['properties'] = array(
Expand Down Expand Up @@ -874,4 +875,19 @@ protected function get_title($title, $url)
$item_name = str_replace(array(chr(10),chr(13)), ' ', $item_name);
return $item_name;
}

/**
* Get encoded title linked to url
* @param $category_id
* @return $color1
*/
protected function get_color($category_id)
{
if ($category_id == 0)
{
$cat = ORM::factory('category', $category_id=1);
$color = $cat->category_color;
}
return $color;
}
}
2 changes: 1 addition & 1 deletion application/i18n
Submodule i18n updated from fc7889 to 82e23c