Code Monkey home page Code Monkey logo

dynmap-export-js's Introduction

dynmap-export-js

简介

在浏览器中将 Dynmap 网页地图上的地图图片合并导出为一张图片。

参数说明

  • dynmap

    指定网页地图页面对外暴露的 dynmap 对象。

  • autoStart

    是否自动开始(不需要执行函数进行确认)。

  • calcOnly

    是否只输出导出范围信息。

  • fillColor

    图片空白区域的颜色。

  • maxTiles

    最多可以请求的地图图片数量,若超出则停止请求并返回结果。

  • mode

    指定导出模式。

    目前有两个模式,均为导出已浏览过的区域(即执行代码前需要通过手动拖动的方式让浏览器加载地图)。

    corner 模式会根据已加载的地图区域计算出矩形范围进行导出,而 viewed 模式则只导出已加载的地图区域。

  • timeout

    确认导出前的等待秒数,若超时则自动取消导出。

使用方法

  1. 访问网页地图页面。

  2. 切换到需要导出的地图并调整到合适的缩放比例。

  3. 打开浏览器的开发人员工具(DevTools)。

  4. 切换到“Sources(源代码)”标签页。

  5. 打开“Snippets(代码片段)”工具。

    devtools-snippets

  6. 创建新的代码片段,将 dynmap-export.jsdynmap-export.min.js 文件中的代码粘贴到其中。

  7. 在代码的末尾添加 exportDynmap({ ...参数 }) 以调用。

    create-snippe

    示例调用方式:

    exportDynmap({
      dynmap: window.dynmap,
      autoStart: false,
      calcOnly: false,
      fillColor: '#FFFFFF',
      maxTiles: null,
      mode: 'corner',
      timeout: 20,
    });
  8. 在网页中拖动地图以加载需要导出的区域。

  9. 回到 DevTools,点击“代码片段”页面左下角的执行按钮。

    autoStart 参数设为 false,则需要切换到“Console(控制台)”标签页,执行提示的函数(confirmExport())。

dynmap-export-js's People

Contributors

frost-zx avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

dynmap-export-js's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.