<body>
<div id="map"></div>
<script>
var extent = [0, 0, 1024, 968];//表示图片的尺寸
var projection = new ol.proj.Projection({
code: 'EPSG:3857',
extent: extent
});
var imageLayer = new ol.layer.Image({
source: new ol.source.ImageStatic({
url: 'image/online_communities.png',
projection: projection,
imageExtent: extent
})
});
var map = new ol.Map({ //初始化map
target: 'map',
layers: [
imageLayer
],
view: new ol.View({
projection: projection,
center: ol.extent.getCenter(extent),
zoom: 2
})
}); </script>
</body>

Openlayers 3 的 imagelayer的更多相关文章

  1. OpenLayers 3 中Layers的相关知识

    昨天自己一遍又一遍的把API里Accessible map那个例子写下来,终于好像有熟悉一点点.找到一篇博文详细讲Layers的.整理一下贴出来(本来想在网上做笔记可以重新排版,比写在本子上要容易有结 ...

  2. openlayers三:添加图片和图标

    openlayers添加图片是指: 添加在地图上的图片会跟随地图同步放大缩小 而添加图标是指: 添加在地图上的图片不会跟随地图同步放大缩小 添加图片: 首先初始化图片图层: initImageLaye ...

  3. 使TileCache配合OpenLayers,产生地图瓦块的一些资料(转)

    在tilecache.cfg中配置好被切割地图的参数,比如: [mytestmap]layers=3,5,7,8type=WMSurl=http://localhost/arcgis/services ...

  4. HTML5 网络拓扑图整合 OpenLayers 实现 GIS 地图应用

    在前面<百度地图.ECharts整合HT for Web网络拓扑图应用>我们有介绍百度地图和 HT for Web 的整合,我们今天来谈谈 OpenLayers 和 HT for Web  ...

  5. OpenLayers.2.10.Beginners.Guide---第一章

    从网上下载openlayers2,解压取得img theme 文件夹和openlayes.js文件.放在同一文件夹下用phpstorm打开. 创建index.html-------------每一行都 ...

  6. OpenLayers的定制

    最近因为工作的需要,把主流的的一些GIS的javascript库看了一遍,主要是ArcGIS Server API for Javascript,Openlayers和Leaflet. 先说说ArcG ...

  7. OpenLayers工作原理

    1.数据组织 OpenLayers通过同层(Layer)进行组织渲染,然后通过数据源设置具体的地图数据来源.因此,Layer与Source是密切相关的对应关系,缺一不可.Layer可看做渲染地图的层容 ...

  8. openlayers 3 简书

    1. 简书http://www.jianshu.com/p/6785e755fa0d 2. 文档 http://anzhihun.coding.me/ol3-primer/ch03/03-02.htm ...

  9. OpenLayers添加点【php请求MySQL数据库返回GeoJSON数据】

    php请求MySQL数据库返回GeoJSON数据的实现方法请参见: http://www.cnblogs.com/marost/p/6234514.html OpenLayers[v3.19.1-di ...

随机推荐

  1. POJ 1042 Gone Fishing#贪心

    (- ̄▽ ̄)-* #include<iostream> #include<cstdio> #include<cstring> using namespace std ...

  2. MySQL聚簇索引

    聚簇索引并不是一种单独的索引类型,而是一种数据存储方式.具体的细节依赖于其实现方式,但innoddb 的聚簇索引实际上在同一个结构中保存了B-Tree索引和数据行. 当表有聚簇索引时,它的数据实际上存 ...

  3. 转:Delphi中destroy, free, freeAndNil, release用法和区别

    http://blog.sina.com.cn/s/blog_44fa172f0101cur1.html 1)destroy:虚方法 释放内存,在Tobject中声明为virtual,通常是在其子类中 ...

  4. 理解php的opcode

    Opcode是一种PHP脚本编译后的中间语言,就像Java的ByteCode,或者.NET的MSL,举个例子,比如你写下了如下的PHP代码: <?php echo "Hello Wor ...

  5. CSS3 transform的demo1

    <!DOCTYPE html> <html> <head> <title>弹出层演示</title> <meta charset=&q ...

  6. socket通信实例

    ref: http://www.cnblogs.com/xudong-bupt/archive/2013/12/29/3483059.html http://blog.csdn.net/love_ga ...

  7. 实现ie6下的居中

    代码如下所示,转自 http://w3help.org/zh-cn/causes/RT8003 对于 text-align 的讨论. <div style="width:200px; ...

  8. MyBatis 错误:Invalid bound statement (not found)

    错误: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.zr.msgg.per ...

  9. Openlayer 3 的画线测量长度

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  10. ZOJ 649 Rescue(优先队列+bfs)

    Rescue Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Sub ...