1

我想我已经很接近了。这个想法是根据 API 中的数据打开背景部分(如果你想尝试一下http://www.propertysolutions.com/api-documentation/code-snippet),仍然有鼠标悬停和选择的功能。为了接近我,我使用了 James 的 Beatles 演示。我在那里,但似乎无法在不关闭背景的情况下添加 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);
});

小提琴 - http://jsfiddle.net/SpudLogic/w4w8U/4/

很想听听一些建议。谢谢!

4

1 回答 1

0

这对我有用

$(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 );

});
于 2013-05-10T22:22:12.887 回答