Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.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
如何在OpenLayers GeometryPoint上设置panTo/setCenter_Openlayers - Fatal编程技术网

如何在OpenLayers GeometryPoint上设置panTo/setCenter

如何在OpenLayers GeometryPoint上设置panTo/setCenter,openlayers,Openlayers,首先,我不熟悉OpenLayers。下面是一个HTML片段,用于表示通过OpenLayers渲染的地图上的两个图像。问题:使用下面的信息,如何以编程方式将这些图像元素之一带入视图?也就是说,我想我想要panTo或setCenter在其中一个元素上。这是一个测试脚本的一部分,我在其中找到图像,将它们一个一个地放到视图中,并对它们采取一些操作。from投影为EPS6:4326,to投影为EPS6:900913。谢谢 <svg id="OpenLayers_Layer_Vector_98_svg

首先,我不熟悉OpenLayers。下面是一个HTML片段,用于表示通过OpenLayers渲染的地图上的两个图像。问题:使用下面的信息,如何以编程方式将这些图像元素之一带入视图?也就是说,我想我想要panTosetCenter在其中一个元素上。这是一个测试脚本的一部分,我在其中找到图像,将它们一个一个地放到视图中,并对它们采取一些操作。from投影为EPS6:4326,to投影为EPS6:900913。谢谢

<svg id="OpenLayers_Layer_Vector_98_svgRoot" style="display: block;" width="1663" height="301" viewBox="0 0 1663 301">
    <g id="OpenLayers_Layer_Vector_98_root" style="visibility: visible;" transform="translate(-33.02402040717425,-1.0000000016589183)">
    <g id="OpenLayers_Layer_Vector_98_vroot">
        <image id="OpenLayers_Geometry_Point_106" cx="458.11467034582165" cy="220.41962755130953" r="1" preserveAspectRatio="none" x="432" y="195" width="51.28563443264394" height="51.28563443264394" xlink:href="http://MyURL/service/maps/getDetails/../chart?cht=pc&chco=ee3324CC|ed8000CC&chd=t:78,22&chs=150x150&chf=bg,s,00000000,o,4,00000040" style="opacity: 1" fill="#000000" fill-opacity="1" stroke="#000000" stroke-opacity="1" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
        <image id="OpenLayers_Geometry_Point_108" cx="622.4436271582672" cy="115.50492808134004" r="1" preserveAspectRatio="none" x="594" y="87" width="57.54611514812745" height="57.54611514812745" xlink:href="http://MyURL/service/maps/getDetails/../chart?cht=pc&chco=ee3324CC|ed8000CC&chd=t:0,100&chs=150x150&chf=bg,s,00000000,o,4,00000040" style="opacity: 1" fill="#000000" fill-opacity="1" stroke="#000000" stroke-opacity="1" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
        <image id="OpenLayers_Geometry_Point_110" cx="437.6028635396797" cy="115.08515270121279" r="1" preserveAspectRatio="none" x="412" y="90" width="50.648406931246505" height="50.648406931246505" xlink:href="http://MyURL/service/maps/getDetails/../chart?cht=p&chco=ee3324CC|ed8000CC&chd=t:0,100&chs=150x150&chf=bg,s,00000000,o,4,00000040" style="opacity: 1" fill="#000000" fill-opacity="1" stroke="#000000" stroke-opacity="1" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
    </g>
        <g id="OpenLayers_Layer_Vector_98_troot"/>
    </g>
</svg>


这是生成的代码,不是吗?因为openlayers使用SVG(IE上除外)渲染向量,但通常不会像这样直接创建向量。画几何图形是相当容易的。你能在JSFIDLE中发布一个例子吗。这个HTML是由。。。对作为测试的一部分,我需要做的是使其中一个点在屏幕上可见。我假设我所知道的只是HTML中的信息以及地图的from和to转换。例如,了解以上内容后,我将如何使用panTo OpenLayers\u Geometry\u Point\u 110?