Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 使用singleSelect但保留背景选择并从API检索数据_Php_Jquery_Imagemapster - Fatal编程技术网

Php 使用singleSelect但保留背景选择并从API检索数据

Php 使用singleSelect但保留背景选择并从API检索数据,php,jquery,imagemapster,Php,Jquery,Imagemapster,我想我已经很接近了。我们的想法是根据API中的数据打开背景部分(如果您想尝试的话,这一部分),并且仍然具有mouseover和select的功能。 为了接近我,我用了詹姆斯的披头士演示。我马上就要到了,但如果不关闭背景,我似乎无法添加singleSelect $(function () { var inArea, map = $('#beatlesIMG'), single_opts = { fillColor: '000000', fillOpacit

我想我已经很接近了。我们的想法是根据API中的数据打开背景部分(如果您想尝试的话,这一部分),并且仍然具有mouseover和select的功能。 为了接近我,我用了詹姆斯的披头士演示。我马上就要到了,但如果不关闭背景,我似乎无法添加singleSelect

$(function () {
var inArea,
map = $('#beatlesIMG'),

    single_opts = {
        fillColor: '000000',
        fillOpacity: 0,
        stroke: true,
        strokeColor: 'ff0000',
        strokeWidth: 2
    },
    all_opts = {
        fillColor: 'ffffff',
        fillOpacity: 0.6,
        stroke: true,
        strokeWidth: 2,
        strokeColor: 'ffffff'
    },
    initial_opts = {
        mapKey: 'data-name'
    };
opts = $.extend({}, all_opts, initial_opts, single_opts);

map.mapster('unbind')
    .mapster(opts)
map.mapster('set_options', all_opts)
    .mapster('set', true, 'all')
    .mapster('set_options', single_opts);
});
小提琴-


我想听听你的建议。谢谢

这对我来说很有用

$(function ()
{
var basic_opts = {
    mapKey: 'data-key1',
    fill: true,
    fillColor: '9A7611',
    fillOpacity: 0.4,
    singleSelect: true
};

var initial_opts = $.extend({},basic_opts, 
    { 
        staticState: true,
        fill: true,
        fillColor: 'F9461C',
        stroke: false
    });
$('#floorplan').mapster(initial_opts)
.mapster('snapshot')
.mapster('rebind',basic_opts );

});