hi all,
I try to change the theme spain, for have a map of world .
all is alright but I'm block with the mouse-over on the map , Nothing appear
I find where is the problem in the main php. the code specify the region but for me I need to specify a country.
So can you help me pls ?
<script type="text/javascript">
$(function() {
var linksRegions = new Array();
var statsRegions = new Array();
<?php
$regions = json_decode(osc_get_preference('region_maps','spain_theme'),true);
if($regions){
foreach($regions as $key => $value){
$regionData = Region::newInstance()->findByPrimaryKey($value);
$regionStats = RegionStats::newInstance()->findByRegionId($value);
echo " linksRegions['$key'] = '".map_region_url($value)."';".PHP_EOL;
echo " statsRegions['$key'] = {name:'".osc_esc_js($regionData['s_name'])."', count:'".$regionStats['i_num_items']."'};".PHP_EOL;
}
}
?>
//find all regions map has assigned a location
$('area').each(function(){
var $_hasClass = $(this).attr('class'); //catching
var $_index = $('area:not([class^="group"])').index($(this));
var colorStatus = true;
$(this).click(function(){
var key = $_index;
if($_hasClass != ''){
key = $_hasClass;
}
if(typeof linksRegions[key] != 'undefined'){
window.location.href = linksRegions[key];
}
return false;
}).hover(function(e){
var key = $_index;
if($_hasClass != ''){
key = $_hasClass;
}
$('#map-tooltip').html(statsRegions[key].name + ': '+statsRegions[key].count + ' ads').css({
top: e.pageY,
left: e.pageX
}).show();
canvas = document.getElementById("map-hover");
canvas.width = canvas.width;
options = {
lineColor: '#de9200',
fillColor: '#ffa800'
}
if($(this).attr('class') != ''){
$('.'+$(this).attr('class')).each(function(){
drawCanvas('map-hover', $(this).attr('coords'), options);
});
} else {
drawCanvas('map-hover', $(this).attr('coords'), options);
}
},function(){
canvas.width = canvas.width;
$('#map-tooltip').hide();
});
});
//
});
</script>