简体   繁体   English

使用自定义控件构建openlayers

[英]Building openlayers with custom controls

I have a couple custom OpenaLayers 3 conrtrols which I wrote. 我写了几个自定义的OpenaLayers 3控件。 All of my controls extend the ol.control.Control . 我所有的控件都扩展了ol.control.Control I'm using requirejs to include open layers into my project, but when I try to do it the goog object is not defined. 我正在使用requirejs将开放层包括到我的项目中,但是当我尝试这样做时,goog对象未定义。 I'm researching now how to make a cutom build of OpenLayers 3 so I can include with it, but I'm wandering if there is a way to do it with building my OpenLayers 3 version with every release. 我现在正在研究如何制作OpenLayers 3的自定义版本,以便可以将其包含在内,但是我想知道是否有办法在每个发行版中构建OpenLayers 3版本。

The following tutorial explains how to build OpenLayers along with your own project source files: http://openlayers.org/en/v3.13.1/doc/tutorials/closure.html 以下教程介绍了如何构建OpenLayers以及您自己的项目源文件: http : //openlayers.org/en/v3.13.1/doc/tutorials/closure.html

This should be enough to get you going. 这应该足以使您前进。

You can also take a look at some other projects that compile OpenLayers with their own source code, as a way to get inspired to how to do your own implementation: 您也可以看看其他一些使用自己的源代码编译OpenLayers的项目,以此来启发如何进行自己的实现:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM