将具有重复ID的功能添加到Vector源

时间:2016-01-27 12:00:47

标签: openlayers-3

现在,如果我将两个具有相同ID的功能添加到Vector源,似乎第二个被丢弃。反正是否强迫OpenLayers用现有ID替换功能?

1 个答案:

答案 0 :(得分:-1)

from distutils.core import setup
import py2exe, sys, os

sys.argv.append('py2exe')

data_files = []
for files in os.listdir('./img/'):
    f1 = './img/' + files
    if os.path.isfile(f1):  # skip directories
        f2 = 'img', [f1]
        data_files.append(f2)

setup(windows=[{'script': 'Artifactory_Spider.py', 'icon_resources': [(0, './img\\tachk.ico')]}],
      data_files=data_files,
      options={'py2exe': {'includes': ['patoolib', 'hurry.filesize'], 'bundle_files': 2, 'compressed': True, 'dist_dir': './Artifactory Spider'}},
      zipfile=None,)

或来自@sox:

var data = { files: []};
media = {
    data: data,
    types: (function()
    {
        var typesList = { image: 10, epc: 1, pdf: 5, floor_plan: 10, video: 1 };

        var typeObj = {

            remaining: function()
            {
                var that = this;

                return that.limit - data.files.filter(function(element)
                    {
                        return element.type == that.name;
                    }).length;
            }
        }

        var allTypes = {};

        $.each(typesList, function(index, element)
        {
            allTypes[index] = Object.create(typeObj, {

                limit: { writable: false,  configurable: false, value: element }
            });
        });

        return allTypes;

    })(),