ImageMapster "highlight" always on

807 views Asked by At

I use jquery, ImageMapster and PHP.

The script works fine, if I load the imagen my area is ON but when I move my mouseOver the image the highlight change ( normal ) but ... when I put my mouseOut of img I have no area selected, and would like my default area ON.

I fix the problem using mouseOut calling always the same area. I would like to do it correctly.

 <script type="text/javascript">
        function mapearImagenVistaGeneral(id) {
            $(id).mapster({
                mapScale     : true,
                fillOpacity  : 0.4,
                fillColor    : "fff000",
                stroke       : true,
                strokeColor  : "000",
                strokeOpacity: 0.8,
                strokeWidth  : 4,
                singleSelect : true,
                mapKey       : 'name',
                listKey      : 'name',
                showToolTip  : true,
                onMouseout: function (e) {
                    $('#imgAlmacen1VistaGeneral').mapster( 'highlight','01');            
                }
            });
        };
        mapearImagenVistaGeneral("#imgAlmacen1VistaGeneral");        
        $('#imgAlmacen1VistaGeneral').mapster( 'highlight','01'); 
1

There are 1 answers

0
Unai Susperregi On

After 2 days finally I found the solution now, after write in stackoverflow...

I have to set one area.

 <script type="text/javascript">
        function mapearImagenVistaGeneral(id) {
            $(id).mapster({
                mapScale     : true,
                fillOpacity  : 0.4,
                fillColor    : "fff000",
                stroke       : true,
                strokeColor  : "000",
                strokeOpacity: 0.8,
                strokeWidth  : 4,
                singleSelect : true,
                mapKey       : 'name',
                listKey      : 'name',
                showToolTip  : true,
                areas: [{
                    key: '01',
                    staticState: true,
                    render_select: {
                        fillOpacity: 0.4,
                        fillColor: '0000ff'
                    }}
                ]
            });
        };
        mapearImagenVistaGeneral("#imgAlmacen1VistaGeneral");