JSFiddle - React, Tailwind, and code Playground

HTML

<div>
<label> <input type="checkbox" id="hide_obj"> Скрыть </label>
<object data="map.svg" type="image/svg+xml" id="imap" ><div id="imap" >
    <?xml version="1.0" standalone="no" ?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="350" height="451" xml:space="preserve"><desc>Created with Fabric.js 1.0.2</desc><image x="0" y="0" width="350" height="451" preserveAspectRatio="none"  style="opacity:1"></image><g transform="translate(102.5 99)"><path width="105" height="100" d="M 0 31 L 63 0 L 105 100 L 0 31 z" style="stroke: Black; stroke-width: 1; stroke-dasharray: ; fill: LightGray; opacity: 1;" transform="translate(-52.5 -50)" /></g><g transform="translate(163.5 261)"><path width="211" height="90" d="M 0 10 L 201 0 L 211 90 L 0 10 z" style="stroke: Black; stroke-width: 1; stroke-dasharray: ; fill: Red; opacity: 1;" transform="translate(-105.5 -45)" /></g><g transform="translate(123 373.5)"><path width="130" height="91" d="M 0 34 L 87 0 L 87 91 L 130 80 L 0 34 z" style="stroke: Black; stroke-width: 1; stroke-dasharray: ; fill: Yellow; opacity: 1;" transform="translate(-65 -45.5)" /></g><g transform="translate(256 389.5)"><path width="98" height="85" d="M 0 0 L 98 5 L 98 81 L 11 85 L 0 0 z" style="stroke: Black; stroke-width: 1; stroke-dasharray: ; fill: Blue; opacity: 1;" transform="translate(-49 -42.5)" /></g><line x1="107" y1="93" x2="284" y2="36" style="stroke: Black; stroke-width: 1; stroke-dasharray: ; fill: Black; opacity: 1;" /><rect x="-25" y="-25" rx="0" ry="0" width="50" height="50" style="stroke: LightGray; stroke-width: 1; stroke-dasharray: ; fill: LightGray; opacity: 1;" transform="translate(284 36)" /><g transform="translate(281.5 30.5)"><text font-family="'Times New Roman'" font-size="30" font-weight="400" style="stroke: none; stroke-width: 1; stroke-dasharray: ; fill: Black; opacity:...

JavaScript

$(function(){
    $('#hide_obj').click( function(e){
       var _this = $(this);
        return (!_this.is(':checked'))  
          ? $('object#imap g').show() : $('object#imap g').hide();
    });
});