Spring boot 环境下配置CKEditor添加google map

本文档基于已经搭建好基础ckeditor的环境上。如:http://www.cnblogs.com/daxin/p/3553865.html

使用leaflet的ckeditor的google map插件;

 

1、下载、解压插件

下载地址:

http://ckeditor.com/addon/leaflet

下面是leaflet依赖的插件

http://ckeditor.com/addon/widgetselection

http://ckeditor.com/addon/widget

http://ckeditor.com/addon/lineutils

将以上包下载,解压到ckeditor/plugins目录下。

 

2、配置ckeditor/config.js

 

config.extraPlugins+="widgetselection,lineutils,widget,leaflet,";
config.leaflet_maps_google_api_key = 'AIzaSyA9ySM6msnGm0qQB1L1cLTMBdKEUKPySmQ';

 这个google map key建议自己再申请一个哦,代码中的是原开发者的,可能不能用了。

 查看一下效果:

3、在java环境中可能会遇到以下错误:

in a frame because it set 'x-frame-options' to 'deny'.

 4、那么别着急,添加一下java配置代码和xml配置即可。

4.1、使用spring xml文件配置

<http>    
    <headers>
        <frame-options policy="SAMEORIGIN"/><!-- 相同域名下允许加载 -->
    </headers>
</http>

 

4.2、使用spring boot代码配置

@Override
    protected void configure(HttpSecurity http) throws Exception { 
        //直接关闭frameOptions功能
        http.headers().frameOptions().disable();
    }

 5、验证一下。

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值