2012年9月 移动平台大版内专家分月排行榜第二
2012年11月 移动平台大版内专家分月排行榜第三
本帖子已过去太久远了,不再提供回复功能。2013年8月 移动平台大版内专家分月排行榜第二2013年4月 移动平台大版内专家分月排行榜第二
2013年5月 移动平台大版内专家分月排行榜第三
2013年8月 移动平台大版内专家分月排行榜第二2013年4月 移动平台大版内专家分月排行榜第二
2013年5月 移动平台大版内专家分月排行榜第三
2013年8月 移动平台大版内专家分月排行榜第二2013年4月 移动平台大版内专家分月排行榜第二
2013年5月 移动平台大版内专家分月排行榜第三
2013年8月 移动平台大版内专家分月排行榜第二2013年4月 移动平台大版内专家分月排行榜第二
2013年5月 移动平台大版内专家分月排行榜第三
2013年8月 移动平台大版内专家分月排行榜第二2013年4月 移动平台大版内专家分月排行榜第二
2013年5月 移动平台大版内专家分月排行榜第三
本帖子已过去太久远了,不再提供回复功能。&&&&&&&&&&&
& & && 参考酸奶小妹的博文《【百度地图API】如何制作一张魔兽地图!!&&CS地图也可以,哈哈哈》 ()。
& & && 及博文 《百度地图:新的瓦片生成工具来了》 链接:,开发的工具下载地址:。
一、制作地图的准备工作
其实,你只需要准备一些地图的瓦片图,就可以了。
用切片工具,把一张完整的图片(最好大一些,清楚一些),切成小片,可使用 TileCutter工具。
二、了解百度地图API的地图图层接口
TileLayer([opts:TileLayerOptions])
创建一个地图图层实例。
& & &接口地址:
使用这个接口,就可以将切好的地图瓦片铺在原有的百度地图上。
var tileLayer = new BMap.TileLayer();tileLayer.getTilesUrl = function(tileCoord, zoom) {
var x = tileCoord.x;
var y = tileCoord.y;
var url = 'images/tiles/' + zoom + '/tile' + x + '_' + y + '.png';
三、限制地图的显示级别
如果,你只切了1-4级的地图,那么你的魔兽地图应该只能显示1-4级。
所以,要对map的显示做一个限制。看下面源代码第一行。
还需要规定出自定义地图类型,看源代码第二行。
第三行,添加的鱼骨控件,只会显示1-4级哟~因为在第一行控制了minZoom和maxZoom。
var MyMap = new BMap.MapType('MyMap', tileLayer, {minZoom: 1, maxZoom: 4});var map = new BMap.Map('container', {mapType: MyMap});map.addControl(new BMap.NavigationControl());
----------------------------------------------------------------------------------
我是采用的
1.利用TileCutter工具将原始图片切为1-5级,原始图片所在级别为2级。
2.直接修改了离线API的js
改为:Uc.getTilesUrl=function(a,b,c){var x=a.x,y=a.y,e=1,z=b;return "tiles/"+z+"/"+x+"/tile"+x+"_"+y+".png";};
3.替换瓦片地图文件夹images/tiles/XXX
阅读(...) 评论()&&&&&&&&&&&
CSS Hack大全-教你如何区分出IE6-IE10、FireFox、Chrome、Opera
现在的浏览器IE6-IE10、Firefox、Chrome、Opera、Safari。。。数量众多,可谓百家争鸣,对用户来说有了很多的可选择型,不过这可就苦了Web前端开发人员了。今天把一些常用的CSS Hack整理了一下,包括常用的IE hack以及火狐、Chrome、Opera浏览器的Hack,并把这些CSS Hack综合的一起,写了一个小的浏览器测试器。如图所示:
下面就来看一下代码吧:
html部分:
复制代码 代码如下:
&div class="content"&&&& &div class="test"&&/div&&&& &div class="txt"&&&&&&&& &p&IE6下背景颜色:&span class="ie6" style=""&#ccc&/span&&/p&&&&&&&& &p&IE7下背景颜色:&span class="ie7" style=""ʚ&/span&&/p&&&&&&&& &p&IE8下背景颜色:&span class="ie8" style=""f&/span&&/p&&&&&&&& &p&IE9下背景颜色:&span class="ie9" style=""&#f00&/span&&/p&&&&&&&& &p&IE10下背景颜色:&span class="ie10" style=""�ff&/span&&/p&&&&&&&&
&p&webkit,Safari,Chrome下背景颜色:&span class="webkit-safari-gg"
style=""&#ff0&/span&&/p&&&&&&&& &p&FireFox下背景颜色:&span class="firefox" style=""&#f0f&/span&&/p&&&&&&&& &p&Opera下背景颜色:&span class="opera" style=""�f0&/span&&/p&&&& &/div&&/div&
CSS部分,此部分就只贴Hack部分的代码吧,布局的就不贴了:
复制代码 代码如下:
.content .test {&&& width: 200&&& height: 200&&& background: #f60; /*all*/&&& background: #06f9; /*IE*/&&& *background: #666; /*IE6,7*/&&& _background: # /*IE6*/}/* webkit and opera */@media all and (min-width:0){&&& .content .test {&&&&&&& background: #0f0;&&& }}/* webkit */@media screen and (-webkit-min-device-pixel-ratio:0) {&&& .content .test {&&&&&&& background: #ff0;&&& }}/* Opera浏览器 */
@media all and (-webkit-min-device-pixel-ratio:10000), not all and (-webkit-min-device-pixel-ratio:0) {
head~body .content .test {&&&&&&& background: #ff0;&&& }
}/*FireFox*/@-moz-document url-prefix() {&&& .content .test {&&&&&&& background: #f0f;&&& }}/*IE9+*/@media all and (min-width:0) {&&& .content .test{&&&&&&& background: #f009;&&&&&&& }}/*IE10+*/@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {&&& .content .test {&&&&&&& background: #0&&& }}
/*iPhone / mobile webkit */
@media screen and (max-device-width: 480px) {
.content .test {&&&& background: #0&&& }
4、IE9浏览器
:root Selector {property: value9;}
上面是IE9的写法,具体应用如下:
:root .demo {color: #ff09;}
5、IE9以及IE9以下版本
Selector {property:value9;}
这种写法只有IE9以及IE9以下版本能识别,注意此处“9”只能是“9”不能是别的,比如说“8”,不然会失去效果的,如:
.demo {background: lime9;}
6、IE8浏览器
Selector {property: value/;} 或者: @media ?screen{ Selector {property:} }
上面写法只有IE能识别,如:
.color {color: #fff/;} 或者: @media ?screen{ .color {color: #} }
7、IE8以及IE8以上的版本
Selector {property: value?;}
这种写法只有IE8以及IE8以上版本支持,如
.demo {color: #ff0?;}
8、IE7浏览器
*+html Selector{property:} 或 *:first-child+html Selector {property:}
上面两种是IE7浏览器下才能识别,如:
*+html .demo {background:} 或者: *:first-child+html .demo {background:}
9、IE7及IE7以下版本浏览器
Selector {*property:}
上面的写法在IE7以及其以下版本都可以识别,如:
.demo {*background:}
10、IE6浏览器
Selector {_property/**/:/**/} 或者: Selector {_property:} 或者: *html Selector {property:}
具体应用如下:
.demo {_width/**/:/**/100} 或者: .demo {_width: 100} 或者: *html .demo {width: 100}
阅读(...) 评论()}