perl open33切换账号怎么换?

ruby更换gem源
ruby更换gem源
围观5152次
编辑日期: 字体:
在使用gem安装软件时提示连接主机失败
[root@365dw ~]# gem install open4 exception_notification
Could not find a valid gem 'open4' (&= 0), here is why:
Unable to download data from https://rubygems.org/ - Errno::ETIMEDOUT: Connection timed out - connect(2) (https://rubygems.org/latest_specs.4.8.gz)
网上有使用代理的方式,但是个人尝试过不太理想。最好的方式是更换gem源,目前国内最好的就是淘宝的源。
更换方式,首先查看gem源
[root@365dw ~]# gem sources
*** CURRENT SOURCES ***
https://rubygems.org/
添加淘宝源
[root@365dw ~]# gem sources -a http://ruby.taobao.org
http://ruby.taobao.org added to sources
删除ruby官方gem源
[root@365dw ~]# gem sources -r https://rubygems.org/
https://rubygems.org/ removed from sources
再使用gem安装
[root@365dw ~]# gem install open4 exception_notification
Fetching: open4-1.3.4.gem (100%)
Successfully installed open4-1.3.4
Installing ri documentation for open4-1.3.4
Fetching: exception_notification-4.0.1.gem (100%)
Successfully installed exception_notification-4.0.1
Installing ri documentation for exception_notification-4.0.1
2 gems installed
可以看到速度飞快,再次感谢淘宝对互联网的贡献。
本文固定链接:
转载请注明: 本文章来自365代维网
作者:miao
365代维网博主,专注互联网技术,热衷于技术研究。
您可能还会对这些文章感兴趣!后使用快捷导航没有帐号?
提示关闭姓名:请输入您的真实姓名*必填手机:请输入有效的电话号码*必填邮箱:请输入有效的邮箱号码*必填您的身份:请选择你的身份合作机构非服务期用户服务期用户金蝶认证伙伴金蝶机构员工金蝶总部员工请选择你的身份申请理由:请输入申请理由*必填暂不申请提交申请
社区账号/云之家账号
记住登录状态
使用合作账号登录
快速安全登录
请使用云之家APP扫描二维码
在修改我的基本信息提示冲突,谁能帮忙清一下网络控制。
打开了重复标签才会出现应该 在原标签处点击退出即可解决
联系我们 (服务) (销售) -9(投诉) (邮箱)金蝶社区移动端关于我们金蝶社区作为金蝶产品官方服务互动门户,服务于金蝶产品用户及伙伴,分享行业知识及优秀案例,推动开放共赢企业生态圈的建立。金蝶版权所有 (C)
Kingdee Software (China) Inc. All Rights Reserved 粤ICP备号-18什么是OpenLayers?
OpenLayers 是一个专为Web GIS 客户端开发提供的JavaScript 类库包,用于实现标准格式发布的地图数据访问。从OpenLayers2.2版本以后,OpenLayers已经将所用到的Prototype.js组件 整合到了自身当中,并不断在Prototype.js的基础上完善面向对象的开发,Rico用到地方不多,只是在OpenLayers.Popup.AnchoredBubble类中圆角化DIV。
我眼里的Openlayer:
& &   说到openlayer不得不说其中的map,map是OpenLayers的核心组件,如果把开发openlayer3过程比做画画的话,那么map就是一个神奇的桌子,它是来承载各式各样的纸(layer),画画的背景想用地图做背景怎么办?这个时候ol.layer.Tile出来了,想加载网格中加载块状地图,非它莫属,想加载客户数据怎么办?ol.layer.Vector帮助你,好了背景图有了,自己画的也加上了,突然发现对背景跟自己画的有点不满意,想自己添加,修改怎么办,给map加上特效,ol.interaction.xxxx,想要画点你就加ol,interaction.Draw,想修改你就加上ol.interaction.Modify,当然在加特效之前你可以对地图做一些渲染,ol.FeatureOverlayer,因为默认的样式画出来的东西不一定会看的清。当然事实上远没有这没简单,每个类都有自己的方法。就说map吧,至少我用到最多的是它的on()跟once()方法,前者监听一种特定类型的事件,后者监听一次特定类型的事件,其中on()跟un()是配对使用的。其他的就不多说了,可以参考一下官方手册。
一些常用的例子
首先从Map的官方参考手册看起
The map is the core component of OpenLayers. For a map to render, a view, one or more layers, and a target container are needed.
从上面Map的定义看,我们可以知道map是OpenLayers的核心组件。对map进行渲染,我们至少需要一个view(视图),一个layers(层)和一个目标的容器。
根据定义我们创建一个
最简单的map。
&meta charset="utf-8"&
&title&GIS开发样例-V1.0&/title&
&meta content="Copyright (c) Leetao" name="copyright"&
&link rel="stylesheet" href="/jslib/openlayer-3.3.0/css/ol.css" type="text/css"&
&script src="/jslib/openlayer-3.3.0/build/ol-debug.js" type="text/javascript"&&/script&
&div id="map" class="map"&&/div&
var map = new ol.Map({
view: new ol.View({
center: [0, 0], //视图的初始中心
//用于缩放视图的初始分辨率
new ol.layer.Tile({
//Tile预渲染层
source: new ol.source.MapQuest({layer: 'osm'})
target: 'map'
结果如图:
简单地图创建结束,接着让我们在地图上画图案
简单的绘图
&meta charset="utf-8"&
&title&GIS开发样例-V1.0&/title&
&meta content="Copyright (c) Leetao" name="copyright"&
&link rel="stylesheet" href="/jslib/openlayer-3.3.0/css/ol.css" type="text/css"&
&script src="/jslib/openlayer-3.3.0/build/ol-debug.js" type="text/javascript"&&/script&
&div id="map" class="map"&&/div&
&form class="form-inline"&
&label&Geometry type &&/label&
&select id="type"&
&option value="None"&None&/option&
&option value="Point"&Point&/option&
&option value="LineString"&LineString&/option&
&option value="Polygon"&Polygon&/option&
var source = new ol.source.Vector();
var vector = new ol.layer.Vector({
source: source
var map = new ol.Map({
view: new ol.View({
center: [0, 0],
new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'osm'})
target: 'map'
//featureOverlay
var featureOverlay = new ol.FeatureOverlay({
style: new ol.style.Style({
fill: new ol.style.Fill({
color: 'rgba(255, 255, 255, 0.2)'
stroke: new ol.style.Stroke({
color: '#ffcc33',
image: new ol.style.Circle({
radius: 7,
fill: new ol.style.Fill({
color: '#ffcc33'
featureOverlay.setMap(map);
var typeSelect = document.getElementById('type');
function addInteraction() {
var value = typeSelect.
if (value !== 'None') {
draw = new ol.interaction.Draw({
features: featureOverlay.getFeatures(),
source: source,
type: /** @type {ol.geom.GeometryType} */ (value)
map.addInteraction(draw);
typeSelect.onchange = function(e) {
map.removeInteraction(draw);
addInteraction();
addInteraction();
结果如下:
上面代码可以让你在Tile上绘点,线以及几何图形,当然如果你把(1)注释了,再尝试在上面绘点,你会发现绘制的图形变成透明的了,
如果你先把(2)注释给取消了,在把(1)给注释了,你会发现,这个时候绘图是可以看见的
绘图结束了就是该修改图了
简单的绘图以及修改图
只需要在原有基础上加个ol.interaction.Modify就可以修改了
代码如下:
&meta charset="utf-8"&
&title&GIS开发样例-V2.0&/title&
&meta content="Copyright (c) Leetao" name="copyright"&
&link rel="stylesheet" href="/jslib/openlayer-3.3.0/css/ol.css" type="text/css"&
&script src="/jslib/openlayer-3.3.0/build/ol-debug.js" type="text/javascript"&&/script&
&div id="map" class="map"&&/div&
&form class="form-inline"&
&label&Geometry type &&/label&
&select id="type"&
&option value="None"&None&/option&
&option value="Point"&Point&/option&
&option value="LineString"&LineString&/option&
&option value="Polygon"&Polygon&/option&
var source = new ol.source.Vector();
var vector = new ol.layer.Vector({
source: source
var map = new ol.Map({
view: new ol.View({
center: [0, 0],
new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'osm'})
target: 'map'
//featureOverlay
var featureOverlay = new ol.FeatureOverlay({
style: new ol.style.Style({
fill: new ol.style.Fill({
color: 'rgba(255, 255, 255, 0.2)'
stroke: new ol.style.Stroke({
color: '#ffcc33',
image: new ol.style.Circle({
radius: 7,
fill: new ol.style.Fill({
color: '#ffcc33'
featureOverlay.setMap(map);
var modify = new ol.interaction.Modify({
features: featureOverlay.getFeatures(),
deleteCondition: function(event) {
return ol.events.condition.shiftKeyOnly(event) &&
ol.events.condition.singleClick(event);
map.addInteraction(modify);
var typeSelect = document.getElementById('type');
var // global so we can remove it later
function addInteraction() {
var value = typeSelect.
if (value !== 'None') {
draw = new ol.interaction.Draw({
features: featureOverlay.getFeatures(),
source: source,
type: /** @type {ol.geom.GeometryType} */ (value)
map.addInteraction(draw);
typeSelect.onchange = function(e) {
map.removeInteraction(draw);
addInteraction();
addInteraction();
当然可以添加特效也可以修改特效,采用map.removeInteraction(),可以在特定事件触发之后禁止修改亦或是禁止绘图
上面都是单层的,如果想加入客户数据,参照样例一,将注释(2)去掉即可。
现在我们尝试从后台加载数据,并对后台传来的数据进行二次修改
修改后台传来的数据
主要采用了ol.interaction.Select()方法
核心代码如下:
var raster = new ol.layer.Tile({
source: new ol.source.MapQuest({
layer: 'sat'
var vector = new ol.layer.Vector({
source: new ol.source.GeoJSON({
projection: 'EPSG:3857',
url: 'data/geojson/countries.geojson'
var select = new ol.interaction.Select();
var modify = new ol.interaction.Modify({
features: select.getFeatures()
var map = new ol.Map({
interactions: ol.interaction.defaults().extend([select, modify]),
layers: [raster, vector],
target: 'map',
view: new ol.View({
center: [0, 0],
其中ol.interaction.Select是用来处理被选中的Vector的数据的。
最后附上官方手册部分翻译(博主自己翻译的,可能有错,只供参考)
如果文章存在错误,请指正。
阅读(...) 评论()在 SegmentFault,解决技术问题
每个月,我们帮助 1000 万的开发者解决各种各样的技术问题。并助力他们在技术能力、职业生涯、影响力上获得提升。
一线的工程师、著名开源项目的作者们,都在这里:
获取验证码
已有账号?
问题对人有帮助,内容完整,我也想知道答案
问题没有实际价值,缺少关键内容,没有改进余地
我在学习python时,使用rlopen,但是报错说module 'urllib.request' has no attribute 'rlopen',我知道这个是python2中的东西,请问python3中应该怎么写。
response = urllib.request.rlopen(webUrl);//webUrl是一个网页地址
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
是urlopen吧?
分享到微博?
关闭理由:
删除理由:
忽略理由:
推广(招聘、广告、SEO 等)方面的内容
与已有问题重复(请编辑该提问指向已有相同问题)
答非所问,不符合答题要求
宜作评论而非答案
带有人身攻击、辱骂、仇恨等违反条款的内容
无法获得确切结果的问题
非开发直接相关的问题
非技术提问的讨论型问题
其他原因(请补充说明)
我要该,理由是:}

我要回帖

更多关于 消消乐怎么切换账号 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信