更新添加日志:在1.1的基础上添加marker的文字显示、测距工具。

/**
* GOOGLE地图开发使用工具
* @author BOONYACHENGDU@GMAIL.COM
* @date 2013-08-23
* @notice 地图容器的z-index不能小于0,否则鼠标地图无法进行地图操作(可以看到地图,不过你会万分苦恼)
*/
(function(){
window.map={};
window.lineFeature=null;
window.markers=[];
window.infoWindow=null;
window.GoogleUtil={};
GoogleUtil={
CONSTANT:{
mapkey:'AIzaSyAY-HsXXPsBUqsbQLDFO8kpNWLANwH0E7k',
container:"map",
DEFAULT_ZOOM:12,
zoomAddFeature:19,
centerLat:30.65721817,
centerLng:104.06594494,
mapstatus:false,
isnewMap:false,
ZOOM_MAX:19,
ZOOM_MIN:0,
markerSize:32
},
/**
* 控制地图显示范围为中国
*/
mapShowBounds:function(){
var strictBounds = new google.maps.LatLngBounds(
new google.maps.LatLng(14.48003790418668, 66.28120434863283),
new google.maps.LatLng(54.44617552862156, 143.71284497363283)
);
google.maps.event.addListener(map, 'dragend',function() {
if (strictBounds.contains(map.getCenter())) {
return;
}
var c = map.getCenter(),
x = c.lng(),
y = c.lat(),
maxX = strictBounds.getNorthEast().lng(),
maxY = strictBounds.getNorthEast().lat(),
minX = strictBounds.getSouthWest().lng(),
minY = strictBounds.getSouthWest().lat();
if (x < minX){x = minX;}
if (x > maxX){x = maxX;}
if (y < minY){y = minY;}
if (y > maxY){y = maxY;}
map.setCenter(new google.maps.LatLng(y, x));
});
},
/**
* 控制地图的缩放级别
*/
limitShowMapZoom:function(zoom){
this.CONSTANT.zoomMax=zoom;
var limitedZoom=this.CONSTANT.zoomMax;
google.maps.event.addListener(map, 'zoom_changed',function() {
if (map.getZoom() < limitedZoom){map.setZoom(limitedZoom);}
});
},
/**
* 异步加载谷歌API
*/
loadScript:function(){
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "http://maps.googleapis.com/maps/api/js?v=3&key="+this.CONSTANT.mapkey+"&sensor=false&libraries=drawing,places";
document.body.appendChild(script);
},
/**
* 谷歌街道
*/
initStreetMap:function(key){
this.CONSTANT.mapkey=key|| this.CONSTANT.mapkey;
var mapOptions = {
center: new google.maps.LatLng(GoogleUtil.CONSTANT.centerLat,GoogleUtil.CONSTANT.centerLng),
zoom: this.CONSTANT.DEFAULT_ZOOM,
panControl: true,
zoomControl: true,
mapTypeControl: false,
scaleControl: true,
scrollwheel:true,
draggable:true,
overviewMapControl: true,
streetViewControl:true,
mapTypeId: google.maps.MapTypeId.ROADMAP,
navigationControlOptions: {
style: google.maps.NavigationControlStyle.ZOOM_PAN,
position: google.maps.ControlPosition.TOP_LEFT
},
zoomControlOptions:{
style: google.maps.ZoomControlStyle.SMALL,//DEFAULT,LARGE,SMALL
position: google.maps.ControlPosition.TOP_LEFT
}
};
map = new google.maps.Map(document.getElementById(this.CONSTANT.container),mapOptions);
//测距控件
GoogleUtil.control.addRulerControl();
//清除测距
GoogleUtil.control.addClearRulerOverlayControl();
},
/**
* 谷歌卫星
*/
initSatelliteMap:function(key){
this.CONSTANT.mapkey=key|| this.CONSTANT.mapkey;
var mapOptions = {
center: new google.maps.LatLng(GoogleUtil.CONSTANT.centerLat,GoogleUtil.CONSTANT.centerLng),
zoom: this.CONSTANT.DEFAULT_ZOOM,
panControl: true,
zoomControl: true,
mapTypeControl: false,
scrollwheel:true,
draggable:true,
scaleControl: true,
overviewMapControl: true,
mapTypeId: google.maps.MapTypeId.SATELLITE,
navigationControlOptions: {
style: google.maps.NavigationControlStyle.ZOOM_PAN,
position: google.maps.ControlPosition.TOP_LEFT
},
zoomControlOptions:{
style: google.maps.ZoomControlStyle.SMALL,//DEFAULT,LARGE,SMALL
position: google.maps.ControlPosition.TOP_LEFT
}
};
map = new google.maps.Map(document.getElementById(this.CONSTANT.container),mapOptions); //测距控件
GoogleUtil.control.addRulerControl();
//清除测距
GoogleUtil.control.addClearRulerOverlayControl();
},
/**
* 谷歌手机
*/
initMobileStreetMap:function(container,key){
this.CONSTANT.mapkey=key|| this.CONSTANT.mapkey;
var mapOptions = {
center: new google.maps.LatLng(GoogleUtil.CONSTANT.centerLat,GoogleUtil.CONSTANT.centerLng),
zoom: this.CONSTANT.DEFAULT_ZOOM,
panControl: false,
zoomControl: true,
mapTypeControl: false,
scaleControl: true,
scrollwheel:true,
draggable:true,
overviewMapControl: true,
streetViewControl:true,
mapTypeId: google.maps.MapTypeId.ROADMAP,
navigationControlOptions: {
style: google.maps.NavigationControlStyle.ZOOM_PAN,
position: google.maps.ControlPosition.TOP_LEFT
},
zoomControlOptions:{
style: google.maps.ZoomControlStyle.SMALL,//DEFAULT,LARGE,SMALL
position: google.maps.ControlPosition.TOP_LEFT
}
};
map = new google.maps.Map(document.getElementById(container||this.CONSTANT.container),mapOptions);
//this.mapShowBounds();
},
/**
* 居中或缩放
*/
centerAndZoom:function(latlng,zoom){
if(latlng){map.setCenter(latlng);}
if(zoom){map.setZoom(zoom);}
},
/**
* 获取图片对象
*/
getIcon:function(imageUrl,size){
var imgSize=size||32;
var offSize=imgSize/2;
var defaultSize=new google.maps.Size(imgSize, imgSize);
var myIcon={
url: imageUrl,
size: defaultSize,
scaledSize:new google.maps.Size(imgSize,imgSize),
origin: new google.maps.Point(0,0),
anchor: new google.maps.Point(offSize,offSize)
};
return myIcon;
},
/**
* 居中并缩放
*/
centerAndZoom:function(point,zoom){
map.setCenter(point);
map.setZoom(zoom);
},
/**
* 创建一个地图bounds对象
* @param points
*/
createBounds:function(points){
if(points) {
var bounds=new google.maps.LatLngBounds();
for ( var i = 0; i < points.length; i++) {
var point=points[i];
if(point){
bounds.extend(point);
}
}
return bounds;
}
return null;
},
/**
* 设置适合的地图边界范围Bounds
* @param points
*/
panToBounds:function(points){
if(points){
var bounds=this.createBounds(points);
if(bounds){map.panToBounds(bounds);}
}
},
/**
* 设置合适的覆盖物显示范围(覆盖物聚合)
*/
getViewport:function(points){
if(points){
var bounds=this.createBounds(points);
if(bounds) {
map.fitBounds(bounds);
}
}
},
/**
* 点越界处理
* @param point
*/
ifOutBoundsPantoCenter:function(point){
var bounds=map.getBounds();
var flag=bounds.contains(point);
if(flag==false){
map.panTo(point);
this.centerAndZoom(point, map.getZoom());
}
}
}; var iterator=0,scount=0,playStatus=0; GoogleUtil.tools={
/**
* 创建信息窗体
*/
createInfoWindow:function(latlng,htmlContent){
var infowindow = new google.maps.InfoWindow({
content: htmlContent,
position:latlng,
disableAutoPan:false
});
return infowindow;
},
/**
* 添加信息窗体
*/
addInfoWindow:function(latlng,htmlContent,isCenter){
if(!infoWindow){
infoWindow=this.createInfoWindow(latlng, htmlContent);
}else{
infoWindow.close();
infoWindow.setPosition(latlng);
infoWindow.setContent(htmlContent);
}
infoWindow.open(map);
if(isCenter){map.setCenter(latlng);}
},
/**
* 创建普通标注
*/
createMarker:function(id,title,point,icon){
var marker = new google.maps.Marker({
position: point,
map: map,
icon:icon,
id:id
});
marker.id=id;
marker.setTitle(title);
return marker;
},
/**
* 创建带有文本描述的标注
*/
createMarkerWithLabel:function(id,title,point,icon){
var marker = new MarkerWithLabel({
position: point,
draggable: false,
map: map,
labelContent: title,
labelAnchor: new google.maps.Point(-1, 15),
labelClass: "labels",
labelStyle: {opacity: 1.0,borderColor:'green',color:'navy',fontSize:'12px'},
icon: icon
});
marker.id=id;
return marker;
},
/**
* 添加普通标注
*/
addCommonMarker:function(id,title,point,icon){
var marker =this.createMarker(id, title, point, icon);
markers.push(marker);
marker.setMap(map);
return marker;
},
/**
* 添加文本标注
*/
addMarkerWithLabel:function(id,title,point,icon){
var marker =this.createMarkerWithLabel(id, title, point, icon);
markers.push(marker);
marker.setMap(map);
return marker;
},
/**
* 添加标注
*/
addMarker:function(id,title,point,icon){
var marker =this.addMarkerWithLabel(id, title, point, icon);
return marker;
},
/**
* 批量添加标注
*/
addMarkers:function(points){
if(points){
for ( var i = 0; i < points.length; i++) {
var point=points[i];
this.addMarker(point);
}
}
},
/**
* 添加跟踪轨迹线条
*/
addLineFeature:function(id,points,style){
lineFeature = new google.maps.Polyline({
path:points,
strokeWeight : style.strokeWeight,
strokeColor :style.strokeColor,
map: map
});
lineFeature.id=id;
lineFeature.track=id;
markers.push(lineFeature);
return lineFeature;
},
/**
* 添加折线(轨迹,包括起点、终点)
*/
addLineFeatureAndStartAndEndPoint:function(spObj,points, startImageUrk,endImageUrk,lineStyle){
var len=points.length;
var index =len - 1;
var startPoint = points[0];
var endPoint =points[index];
var startIcon = GoogleUtil.getIcon(startImageUrk,20);
var endIcon = GoogleUtil.getIcon(endImageUrk,20);
this.addMarker("start", spObj.start, startPoint, startIcon);
this.addMarker("end", spObj.end, endPoint, endIcon);
if(len>=2){
var d=(len/2)+"";
d=parseInt(d);
GoogleUtil.centerAndZoom(points[d],12);
}
this.addLineFeature("track_line",points,lineStyle);
},
/**
* 标注动画
*/
markerAnimate:{
dropSetTimeout:{
drop:function(points){
iterator=0;
for (var i = 0; i < points.length; i++) {
setTimeout(function() {
GoogleUtil.tools.markerAnimate.dropSetTimeout.addMarker(points);
}, i * 200);
}
},
addMarker:function(points){
markers.push(new google.maps.Marker({
position: points[iterator],
map: map,
draggable: false,
animation: google.maps.Animation.DROP
}));
iterator++;
}
}
},
/**
* 轨迹操作
*/
track:{
/**
* 添加轨迹线条
*/
addLineTrack:function(points){
if(points){
var lineCoordinates=[];
for ( var i = 0; i < points.length; i++) {
var point=points[i];
if(point){
lineCoordinates.push(point);
}
}
var lineSymbol = {
path: google.maps.SymbolPath.FORWARD_CLOSED_ARROW,
//scale: 2,
strokeColor: 'green'
};
lineFeature = new google.maps.Polyline({
path: lineCoordinates,
strokeColor: 'red',
strokeWeight : 3,
icons: [{
icon: lineSymbol,
offset: '0%'
}],
map: map
});
lineFeature.id="track_line";
}
},
/**
* 轨迹回放操作
*/
operate:{
count:0,
object:null,
addListener:function(){
var animate=window.setInterval(function() {
scount = (scount + 1) % 200;
var icons = lineFeature.get('icons');
icons[0].offset = (scount / 2) + '%';
lineFeature.set('icons', icons);
//终点停车
if((scount / 2)>=99){
clearInterval(this);
}
}, 1000);
this.object=animate;
},
play:function(){
playStatus=1;
scount=0;
lineFeature.playStatus=playStatus;
this.addListener();
},
continuePlay:function(){
playStatus=3;
lineFeature.playStatus=playStatus;
this.addListener();
},
pause:function(){
playStatus=2;
lineFeature.playStatus=playStatus;
if(this.object){clearInterval(this.object);}
},
stop:function(){
playStatus=4;
lineFeature.playStatus=playStatus;
if(this.object){clearInterval(this.object);}
scount=0;
}
}
},
getOverlayByNodeId:function(id,value){
for (var i = 0; i < markers.length; i++) {
var marker=markers[i];
if(marker[id]==value){
return marker;
}
}
return null;
},
/**
* 删除或显示覆盖物
*/
deleteOrShowMarkerOverlayers:function(map){
for (var i = 0; i < markers.length; i++) {
if(map==null){markers[i].setVisible(false);}
markers[i].setMap(map);
}
if(map==null){markers = [];}
},
/**
* 删除轨迹
*/
deleteTrack:function(){
if(lineFeature){
lineFeature.setVisible(false);
lineFeature.setMap(null);
}
},
/**
* 移除所有覆盖物
*/
removeAllOverlays:function(){
for (var i = 0; i < markers.length; i++) {
markers[i].setVisible(false);
markers[i].setMap(map);
}
markers = [];
},
/**
* 移除一个覆盖物
*/
removeOverlay:function(propertyName,value){
if(value){
for (var i = 0; i < markers.length; i++) {
var marker=markers[i];
if(marker[propertyName]==value){
markers[i].setVisible(false);
markers[i].setMap(map);
}
}
}
if(propertyName=="track"||propertyName=="track_line"){
if(lineFeature){
lineFeature.setVisible(false);
lineFeature.setMap(null);
lineFeature=null;
}
}
},
/**
* 显示或隐藏标注
*/
isToShowMarkers:function(markers,bool){
if(markers){
for (var i = 0; i < markers.length; i++) {
var marker=markers[i];
marker.setVisible(bool);
}
}
},
/**
* 删除轨迹覆盖物
*/
removeTrackLineWithStartAndEndOverlay:function(){
this.removeOverlay("id", "track_line");
this.removeOverlay("id", "track");
this.removeOverlay("id", "start");
this.removeOverlay("id", "end");
if(lineFeature){
lineFeature.setVisible(false);
lineFeature.setMap(null);
lineFeature=null;
}
this.removeAllOverlays();
}
}; GoogleUtil.event={
/**
* 地图缩放事件
*/
mapZoomChanged:function(markers,zoom){
var listener=google.maps.event.addListener(map, 'zoom_changed', function(event) {
if(map.getZoom()<zoom){
var myMarkers=markers;
GoogleUtil.tools.isToShowMarkers(markers,false);//隐藏标注
markers=myMarkers;
}else{
GoogleUtil.tools.isToShowMarkers(markers,true);//显示标注
}
});
return listener;
},
/**
* 点击标注事件
*/
markerClick:function(marker){
var listener=google.maps.event.addListener(marker, 'click', function(event) {
marker.infoWindow.open(map,marker);
});
return listener;
},
/**
* 移除监听对象
*/
removeListener:function(listener){
google.maps.event.removeListener(listener);
}
}; //测距变量
var polyline;
var polylinesArray = [];
//距离标记数组
var lenArray = [];
var rulerActions=[]; GoogleUtil.control={
/**
* 测距控件
*/
addRulerControl:function(){
var RulerControl=function(rulerControlDiv, map){ rulerControlDiv.style.padding = '5px'; // CSS 边框
var controlUI = document.createElement('div');
controlUI.style.backgroundColor = 'white';
controlUI.style.color = '#888888';
controlUI.style.borderStyle = 'solid';
controlUI.style.borderWidth = '1px';
controlUI.style.cursor = 'pointer';
controlUI.style.textAlign = 'center';
controlUI.title = '点击测量距离';
rulerControlDiv.appendChild(controlUI); // CSS 文本
var controlText = document.createElement('div');
controlText.style.fontFamily = 'Arial,sans-serif';
controlText.style.fontSize = '10px';
controlText.style.paddingLeft = '4px';
controlText.style.paddingRight = '4px';
controlText.innerHTML = '测距';
controlUI.appendChild(controlText); google.maps.event.addDomListener(controlUI, 'click', function() {
//启动整个地图的click侦听
var rule = google.maps.event.addListener(map,"click",function(event){
var marker = new MarkerWithLabel({
position: event.latLng,
draggable: false,
map: map,
labelContent: "0.000公里",
labelAnchor: new google.maps.Point(-1, -1),
labelClass: "labels",
labelStyle: {opacity: 1.0},
icon: {}
});
//将标记压入数组
lenArray.push(marker);
//计算距离
var distance = GoogleUtil.control.drawOverlay();
marker.set("labelContent",distance);
});
rulerActions.push(rule);
});
}; var rulerControlDiv = document.createElement('div');
RulerControl(rulerControlDiv, map);
rulerControlDiv.index = 1;
map.controls[google.maps.ControlPosition.LEFT_TOP].push(rulerControlDiv);
},
/**
* 清除测距
*/
addClearRulerOverlayControl:function(){
var RulerControl=function(rulerControlDiv, map){ rulerControlDiv.style.padding = '5px'; // CSS 边框
var controlUI = document.createElement('div');
controlUI.style.backgroundColor = 'white';
controlUI.style.color = '#888888';
controlUI.style.borderStyle = 'solid';
controlUI.style.borderWidth = '1px';
controlUI.style.cursor = 'pointer';
controlUI.style.textAlign = 'center';
controlUI.title = '点击清除测距';
rulerControlDiv.appendChild(controlUI); // CSS 文本
var controlText = document.createElement('div');
controlText.style.fontFamily = 'Arial,sans-serif';
controlText.style.fontSize = '10px';
controlText.style.paddingLeft = '4px';
controlText.style.paddingRight = '4px';
controlText.innerHTML = '清除';
controlUI.appendChild(controlText); google.maps.event.addDomListener(controlUI, 'click', function() {
while(rulerActions[0]){
google.maps.event.removeListener(rulerActions.pop());
}
while(lenArray[0]){
lenArray.pop().setMap(null);
}
if (polylinesArray) {
for (i in polylinesArray) {
polylinesArray[i].setMap(null);
}
polylinesArray = [];
}
});
}; var rulerControlDiv = document.createElement('div');
RulerControl(rulerControlDiv, map);
rulerControlDiv.index = 1;
map.controls[google.maps.ControlPosition.LEFT_TOP].push(rulerControlDiv);
},
/**
* 测距绘制
*/
drawOverlay:function(){
//路线数组
var flightPlanCoordinates = [];
//将坐标压入路线数组
if (lenArray) {
for (i in lenArray) {
flightPlanCoordinates.push(lenArray[i].getPosition());
}
}
//路径选项
var polylineOptions = {
path : flightPlanCoordinates,
map : map,
strokeColor : "#FC7F43",
strokeOpacity : 1.0,
strokeWeight : 2
};
polyline = new google.maps.Polyline(polylineOptions);
//清除原有折线路径
if (polylinesArray) {
for (i in polylinesArray) {
polylinesArray[i].setMap(null);
}
polylinesArray = [];
}
polyline.setMap(map);
polylinesArray.push(polyline);
return ((polyline.getLength()/1000).toFixed(3) + "公里");
} }; //google 测距
google.maps.LatLng.prototype.distanceFrom = function(latlng) {
var lat = [this.lat(), latlng.lat()];
var lng = [this.lng(), latlng.lng()];
var R = 6378137;
var dLat = (lat[1] - lat[0]) * Math.PI / 180;
var dLng = (lng[1] - lng[0]) * Math.PI / 180;
var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(lat[0] * Math.PI / 180) * Math.cos(lat[1] * Math.PI / 180) * Math.sin(dLng / 2) * Math.sin(dLng / 2);
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
var d = R * c;
return Math.round(d);
}; google.maps.Marker.prototype.distanceFrom = function(marker) {
return this.getPosition().distanceFrom(marker.getPosition());
}; google.maps.Polyline.prototype.getLength = function() {
var d = 0;
var path = this.getPath();
var latlng;
for (var i = 0; i < path.getLength() - 1; i++) {
latlng = [path.getAt(i), path.getAt(i + 1)];
d += latlng[0].distanceFrom(latlng[1]);
}
return d;
}; })();
//window.onload= GoogleUtil.loadScript();

Google map v3 using simple tool file google.map.util.js v 1.2的更多相关文章

  1. Google map v3 using simple tool file google.map.util.js v 1.0

    /** * GOOGLE地图开发使用工具 * @author BOONYACHENGDU@GMAIL.COM * @date 2013-08-23 * @notice 地图容器的(div)z-inde ...

  2. Google map v3 using simple tool file google.map.util.js v 1.1

    /** * GOOGLE地图开发使用工具 * @author BOONYACHENGDU@GMAIL.COM * @date 2013-08-23 * @notice 地图容器的z-index不能小于 ...

  3. 使用google map v3 api 开发地图服务

    Google Map V3 API 学习地址: http://code.google.com/intl/zh-CN/apis/maps/documentation/javascript/article ...

  4. Google Maps V3 之 路线服务

    概述 您可以使用 DirectionsService 对象计算路线(使用各种交通方式).此对象与 Google Maps API 路线服务进行通信,该服务会接收路线请求并返回计算的结果.您可以自行处理 ...

  5. Google API v3 设置Icon问题处理

    1.查看API实现 //虽然比较符合API实现的思想但这个没法; //会产生Uncaught TypeError: undefined is not a function //google API n ...

  6. 怎样用Google APIs和Google的应用系统进行集成(2)----Google APIs的全部的RESTFul服务一览

    上篇文章,我提到了,Google APIs暴露了86种不同种类和版本号的API.我们能够通过在浏览器里面输入https://www.googleapis.com/discovery/v1/apis这个 ...

  7. 高效率使用google,国外搜索引擎,国内顺利使用Google的另类技巧,可用谷歌镜像, 可用google学术, 如何使用robots不让百度和google收录

    Google良好的搜索和易用性已经得到了广大网友的欢迎,但是除了我们经常使用的Google网站.图像和新闻搜索之外,它还有很多其他搜索功能和搜索技巧.如果我们也能充分利用,必将带来更大的便利.这里我介 ...

  8. [Google Guava] 强大的集合工具类:java.util.Collections中未包含的集合工具

    转载的,有问题请联系我 原文链接 译文链接 译者:沈义扬,校对:丁一 尚未完成: Queues, Tables工具类 任何对JDK集合框架有经验的程序员都熟悉和喜欢java.util.Collecti ...

  9. Idea运行时Scala报错Exception in thread "main" java.lang.NoSuchMethodError:com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V

    一.情况描述 使用idea +scala+spark,运行程序代码如下: package cn.idcast.hello import org.apache.spark.rdd.RDD import ...

随机推荐

  1. Qt 框架的图形性能高(OpenGL上的系统效率高),网络性能低,开发效率高,Quick是可以走硬件加速——Qt中分为好几套图形系统,差不多代表了2D描画的发展史。最经典的软描画系统

    -----图形性能部分-----Qt的widgets部分,运行时的图像渲染性能是一般的,因为大部分的界面内容都是Qt自绘,没有走硬件加速,也就是说很多图形内容都是CPU算出来的.但是widgets底层 ...

  2. C# 伪造 referer 提交数据

    private string SendRequest(string account, string cardNumber, string cardPass) { string targetUrl = ...

  3. javascript调试

    今天,发现了一个之前从未注意的角落,相信能够大大提高自己写JS的速度.能够迅速发现错误. 例如,今天的加班中调试一个js错误发现的一个例子. 1.Google浏览器报的错 以上是google浏览器报的 ...

  4. 《编程珠玑》第二章 aha算法

    A题:给定一个最多包含40亿个随机排列的32位整数的顺序文件,找出一个不在文件中的32位整数. 1.在文件中至少存在这样一个数? 2.如果有足够的内存,如何处理? 3.如果内存不足,仅可以用文件来进行 ...

  5. ###Git 基础图解、分支图解、全面教程、常用命令###

    一.Git 基础图解 转自:http://www.cnblogs.com/yaozhongxiao/p/3811130.html Git 图解剖析 git中文件内容并没有真正存储在索引(.git/in ...

  6. PHP伪静态与短链接

    如今,Web服务高速发展的时代,各式各类的门户网站,如新浪http://www.sina.com.腾讯http://www.qq.com,这些网站大家都很容易记住,因为这种名称都是有规则和含义的.如果 ...

  7. SDP简要解析

    1.概述SDP也是MMUSIC工作组的一个产品,在MBONE内容中用得很多.其目的就是在媒体会话中,传递媒体流信息,允许会话描述的接收者去参与会话.SDP基本上在internet上工作.他定义了会话画 ...

  8. 认识Log4j

    Log4j是一个非常强大的log记录软件,下面我们就来看看在项目中如何使log4j. 首先当然是得到log4j的jar档,推荐使用1.2.X版,下载地址: http://logging.apache. ...

  9. Android 四大组件之 BroadcastReceiver

    0  简介        BroadcastReceiver也就是“广播接收者”的意思,顾名思义,它就是用来接收来自系统和应用中的 广播.        在Android系统中,广播体现在方方面面,例 ...

  10. JS获取request字符串

    function getQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&] ...