RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

Close
  • 主页
  • 系统&网络
    • 热门问题
    • 最新问题
    • 标签
  • Ubuntu
    • 热门问题
    • 最新问题
    • 标签
  • 帮助
主页 / 问题 / 553781
Accepted
Гончаров Александр
Гончаров Александр
Asked:2020-08-10 08:05:21 +0000 UTC2020-08-10 08:05:21 +0000 UTC 2020-08-10 08:05:21 +0000 UTC

俄罗斯HTML5地图,有免费的吗?[关闭]

  • 772
关闭 这个问题是题外话。目前不接受回复。

根据帮助中描述的规则,这个问题很可能不对应俄语中 Stack Overflow 的主题。

5 年前关闭。

改进问题

对嵌入网页中的俄罗斯地图感兴趣,具有可点击区域,区域中有可调整的悬停,而不是 flash。最好是未混淆的 JS 代码。

这样的付费地图 http://fla-shop.com.ru/products/html5/ru-locator-map/很受欢迎。有这样一个免费的http://evrohimservis.ru/map/ - 显然是第一张地图的盗版。

有没有类似的免费非盗版JS插件?

javascript
  • 2 2 个回答
  • 10 Views

2 个回答

  • Voted
  1. Best Answer
    Абрамов Алексей
    2020-08-31T17:50:29Z2020-08-31T17:50:29Z

    Yandex 也有,绝对免费https://tech.yandex.ru/maps/jsbox/2.1/regions

    var REGIONS_DATA = {
            region: {
                title: 'Регион',
                items: [{
                    id: '001',
                    title: 'Страны мира'
                }, {
                    id: 'BY',
                    title: 'Беларусь'
                }, {
                    id: 'KZ',
                    title: 'Казахстан'
                }, {
                    id: 'RU',
                    title: 'Россия'
                }, {
                    id: 'TR',
                    title: 'Турция'
                }, {
                    id: 'UA',
                    title: 'Украина'
                }]
            },
            lang: {
                title: 'Язык',
                items: [{
                    id: 'en',
                    title: 'Английский'
                }, {
                    id: 'be',
                    title: 'Белорусский'
                }, {
                    id: 'kk',
                    title: 'Казахский'
                }, {
                    id: 'ru',
                    title: 'Русский'
                }, {
                    id: 'tr',
                    title: 'Турецкий'
                }, {
                    id: 'uk',
                    title: 'Украинский'
                }]
            },
            quality: {
                title: 'Точность границ',
                items: [{
                    id: '0',
                    title: '0'
                }, {
                    id: '1',
                    title: '1'
                }, {
                    id: '2',
                    title: '2'
                }, {
                    id: '3',
                    title: '3'
                }]
            }
        },
        // Шаблон html-содержимого макета.
        optionsTemplate = [
            '<div style="line-height: 34px; background-color: #80808080;" id="regions-params">',
            '{% for paramName, param in data.params %}',
            '{% for key, value in state.values %}',
            '{% if key == paramName %}',
            '<div class="btn-group btn-group-xs">',
            '<button{% if state.enabled %}{% else %} disabled{% endif %} type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">',
            '<span>{{ param.title }}</span>',
            '<span class="value">: {{ value }}</span>',
            '&nbsp;<span class="caret"></span>',
            '</button>',
            '<ul class="dropdown-menu {{ paramName }}">',
            '{% for item in param.items %}',
            '<li{% if item.id == value %} class="active"{% endif %}>',
            '<a href="#" data-param="{{ paramName }}" data-id="{{ item.id }}">',
            '{{ item.title }}',
            '</a>',
            '</li>',
            '{% endfor %}',
            '</ul>',
            '</div>&nbsp;',
            '{% endif %}',
            '{% endfor %}',
            '{% endfor %}',
            '</div>'
        ].join('');
    
    ymaps.ready(init);
    
    function init() {
        // Создадим собственный макет RegionControl.
        var RegionControlLayout = ymaps.templateLayoutFactory.createClass(optionsTemplate, {
                build: function () {
                    RegionControlLayout.superclass.build.call(this);
                    this.handleClick = ymaps.util.bind(this.handleClick, this);
                    $(this.getParentElement)
                        .on('click', 'a', this.handleClick);
                },
                clear: function () {
                    $(this.getParentElement)
                        .off('click', 'a', this.handleClick);
                    RegionControlLayout.superclass.clear.call(this);
                },
                handleClick: function (e) {
                    e.preventDefault();
                    var $target = $(e.currentTarget);
                    var state = this.getData().state;
                    var newValues = ymaps.util.extend({}, state.get('values'));
                    if (!$target.hasClass('active')) {
                        newValues[$target.data('param')] = $target.data('id');
                        state.set('values', newValues);
                    }
                }
            }),
            // Наследуем класс нашего контрола от ymaps.control.Button.
            RegionControl = ymaps.util.defineClass(function (parameters) {
                RegionControl.superclass.constructor.call(this, parameters);
                this.regions = new ymaps.GeoObjectCollection();
            }, ymaps.control.Button, /** @lends ymaps.control.Button */{
                onAddToMap: function (map) {
                    RegionControl.superclass.onAddToMap.call(this, map);
                    map.geoObjects.add(this.regions);
                    this.setupStateMonitor();
                    this.loadRegions(this.state.get('values'));
                },
    
                onRemoveFromMap: function (map) {
                    map.geoObjects.remove(this.regions);
                    this.clearStateMonitor();
                    RegionControl.superclass.onRemoveFromMap.call(this, map);
                },
    
                setupStateMonitor: function () {
                    this.stateMonitor = new ymaps.Monitor(this.state);
                    this.stateMonitor.add('values', this.handleStateChange, this);
                },
    
                clearStateMonitor: function () {
                    this.stateMonitor.removeAll();
                },
    
                handleStateChange: function (params) {
                    this.loadRegions(params);
                },
    
                handleRegionsLoaded: function (res) {
                    this.regions
                        .removeAll()
                        .add(res.geoObjects);
                    this.getMap().setBounds(
                        this.regions.getBounds(),
                        {checkZoomRange: true}
                    );
                },
    
                loadRegions: function (params) {
                    this.disable();
                    return ymaps.regions.load(params.region, params)
                        .then(this.handleRegionsLoaded, this)
                        .always(this.enable, this);
                }
            }),
    
            map = new ymaps.Map('map', {
                center: [50, 30],
                zoom: 3,
                controls: ['typeSelector']
            }, {
                typeSelectorSize: 'small'
            }),
    
            // Создадим экземпляр RegionControl.
            regionControl = new RegionControl({
                state: {
                    enabled: true,
                    values: {
                        region: 'RU',
                        lang: 'ru',
                        quality: '1'
                    }
                },
                data: {
                    params: REGIONS_DATA
                },
                options: {
                    layout: RegionControlLayout
                },
                float: 'left',
                maxWidth: [300]
            });
    
        // Добавим контрол на карту.
        map.controls.add(regionControl);
        // Узнавать о изменениях параметров RegionControl можно следующим образом.
        regionControl.events.add('statechange', function (e) {
            console.log(e.get('target').get('values'));
        });
    }
    <!DOCTYPE html>
    
    <html>
    
    <head>
        <title>Примеры. Регионы</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <script src="https://api-maps.yandex.ru/2.1-dev/?lang=ru_RU" type="text/javascript"></script>
        <link rel="stylesheet" href="https://yastatic.net/bootstrap/3.3.4/css/bootstrap.min.css"/>
        <script src="https://yastatic.net/jquery/2.2.3/jquery.min.js"></script>
        <script src="https://yastatic.net/bootstrap/3.3.4/js/bootstrap.min.js"></script>
        <script src="regions.js" type="text/javascript"></script>
        <style>
            html, body, #map {
                width: 100%;
                height: 100%;
                padding: 0;
                margin: 0;
            }
        </style>
    </head><body>
    <div id="map">
    </div>
    </body></html>

    嗯,是的,您不需要检查这是否是一张被盗的卡。是的,没有办法检查。您可以指定一个链接,指向您下载的来源以及它是免费的。也去更正来源,混淆视听。

    • 2
  2. alex87.ru
    2020-02-05T19:40:04Z2020-02-05T19:40:04Z

    为什么这张地图http://evrohimservis.ru/map/不适合你?服用并使用

    • -1

相关问题

Sidebar

Stats

  • 问题 10021
  • Answers 30001
  • 最佳答案 8000
  • 用户 6900
  • 常问
  • 回答
  • Marko Smith

    如何停止编写糟糕的代码?

    • 3 个回答
  • Marko Smith

    onCreateView 方法重构

    • 1 个回答
  • Marko Smith

    通用还是非通用

    • 2 个回答
  • Marko Smith

    如何访问 jQuery 中的列

    • 1 个回答
  • Marko Smith

    *.tga 文件的组重命名(3620 个)

    • 1 个回答
  • Marko Smith

    内存分配列表C#

    • 1 个回答
  • Marko Smith

    常规赛适度贪婪

    • 1 个回答
  • Marko Smith

    如何制作自己的自动完成/自动更正?

    • 1 个回答
  • Marko Smith

    选择斐波那契数列

    • 2 个回答
  • Marko Smith

    所有 API 版本中的通用权限代码

    • 2 个回答
  • Martin Hope
    jfs *(星号)和 ** 双星号在 Python 中是什么意思? 2020-11-23 05:07:40 +0000 UTC
  • Martin Hope
    hwak 哪个孩子调用了父母的静态方法?还是不可能完成的任务? 2020-11-18 16:30:55 +0000 UTC
  • Martin Hope
    Qwertiy 并变成3个无穷大 2020-11-06 07:15:57 +0000 UTC
  • Martin Hope
    koks_rs 什么是样板代码? 2020-10-27 15:43:19 +0000 UTC
  • Martin Hope
    user207618 Codegolf——组合选择算法的实现 2020-10-23 18:46:29 +0000 UTC
  • Martin Hope
    Sirop4ik 向 git 提交发布的正确方法是什么? 2020-10-05 00:02:00 +0000 UTC
  • Martin Hope
    Arch ArrayList 与 LinkedList 的区别? 2020-09-20 02:42:49 +0000 UTC
  • Martin Hope
    iluxa1810 哪个更正确使用:if () 或 try-catch? 2020-08-23 18:56:13 +0000 UTC
  • Martin Hope
    faoxis 为什么在这么多示例中函数都称为 foo? 2020-08-15 04:42:49 +0000 UTC
  • Martin Hope
    Pavel Mayorov 如何从事件或回调函数中返回值?或者至少等他们完成。 2020-08-11 16:49:28 +0000 UTC

热门标签

javascript python java php c# c++ html android jquery mysql

Explore

  • 主页
  • 问题
    • 热门问题
    • 最新问题
  • 标签
  • 帮助

Footer

RError.com

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

帮助

© 2023 RError.com All Rights Reserve   沪ICP备12040472号-5