Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/414.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/77.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
Javascript 每个ModifyFeature的OpenLayers自定义图形_Javascript_Jquery_Openlayers_Openstreetmap - Fatal编程技术网

Javascript 每个ModifyFeature的OpenLayers自定义图形

Javascript 每个ModifyFeature的OpenLayers自定义图形,javascript,jquery,openlayers,openstreetmap,Javascript,Jquery,Openlayers,Openstreetmap,我是OpenLayers的新手,但我希望我的ModifyFeatures有两个不同的图形图标 我目前有一个活动的拖动功能和调整大小功能,拖动应该有一个不同的图标比调整大小 我可以通过以下方式为这两个功能设置图形: new OpenLayers.Style({ 'externalGraphic': '/content/themes/base/imgs/mapdraw_move.png', } 但是,这两个功能都将替换为此图像 我已经在教程中尝试过: OpenLayers.

我是OpenLayers的新手,但我希望我的ModifyFeatures有两个不同的图形图标

我目前有一个活动的拖动功能和调整大小功能,拖动应该有一个不同的图标比调整大小

我可以通过以下方式为这两个功能设置图形:

new OpenLayers.Style({
    'externalGraphic': '/content/themes/base/imgs/mapdraw_move.png',
}
但是,这两个功能都将替换为此图像

我已经在教程中尝试过:

        OpenLayers.Control.DragGraphicFeature = OpenLayers.Class(
            OpenLayers.Control.ModifyFeature, {
                dragHandleStyle: null,
                initialize: function (layer, options) {
                    this.mode = OpenLayers.Control.ModifyFeature.DRAG;
                    var init_style = OpenLayers.Util.extend({}, OpenLayers.Feature.Vector.style.select);
                    this.dragHandleStyle = OpenLayers.Util.extend(init_style, {
                        externalGraphic: "/content/themes/base/imgs/mapdraw_resize.png",
                        fillOpacity: 1
                    });
                },
                CLASS_NAME: "OpenLayers.Control.DragGraphicFeature"
            });
但这有一个负面的结果