...
If you look in application/controllers/main.php, you'll see:
Code Block | ||
---|---|---|
| ||
$div_map = new View('main/map'); |
...
$div_timeline = new View('main/timeline'); |
...
Event::run('ushahidi_filter.map_main', $div_map); |
...
Event::run('ushahidi_filter.map_timeline', $div_timeline); |
...
$this->template->content->div_map = $div_map; |
...
$this->template->content->div_timeline = $div_timeline; |
This creates the map and timeline, filters them, and adds them to the current view (see above). The map file is in themes\default\views\main\map.php
To activate the map, you'll need to add the following lines to the code
Code Block | ||
---|---|---|
| ||
$this->themes->map_enabled = TRUE; //Loads Ushahidi's map JS files
$this->themes->js = new View('main/my_map_js'); //path to your js file containing map instructions
// From here on, you may or may not need the lines below, depending on the map you're using
$this->themes->js->marker_radius = ($marker_radius >=1 AND $marker_radius <= 10 )
? $marker_radius
: 5;
$this->themes->js->marker_opacity = ($marker_opacity >=1 AND $marker_opacity <= 10 )
? $marker_opacity * 0.1
: 0.9;
$this->themes->js->marker_stroke_width = ($marker_stroke_width >=1 AND $marker_stroke_width <= 5)
? $marker_stroke_width
: 2;
$this->themes->js->marker_stroke_opacity = ($marker_stroke_opacity >=1 AND $marker_stroke_opacity <= 10)
? $marker_stroke_opacity * 0.1
: 0.9; |
The script above looks for a map on the main/my_map_js.php
file. We suggest you copy the JS from default/views/main/main_js.php
and start customizing it as you wish.
To be continued...