如何在javascript中将对象转换为图像并在本地存储图像?

时间:2016-12-06 10:08:32

标签: javascript arcgis-js-api

您好我正在尝试将对象转换为图像,我想存储该图像并绑定到html元素。当我加载本地图像时它正常工作。如何将对象转换为图像。我正在尝试编写代码< / p>

 on(State, 'update-end', function () {

        esriRequest({
            "url": StateUrl,
            "content": {
                "f": "json"
            },
            "callbackParamName": "callback"
        }).
   then(function (evt) {
       var graphicstmp = evt.drawingInfo.renderer.symbol.outline;
       var stateOutLine = new SimpleLineSymbol(graphicstmp);

       var stateimg = localStorage.setItem("stateOutLine", stateOutLine);
       var dataImage = localStorage.getItem('stateOutLine');
       var x = document.getElementById('symbolState').setAttribute('src', 'dataImage');

       document.getElementById("symbolState").innerHTML = x;
       console.log(graphicstmp);
       alert(stateOutLine);
   });

});

控制台输出

color

    [0, 115, 76, 255]
style

    "esriSLSSolid"
type

    "esriSLS"
width

    1.7

0 个答案:

没有答案