Google Maps API and WMS Servers

Google Maps API and WMS Servers

James Fee and others have pointed out that Cubewerks is offering an add-on to their server product that offers Google Maps data as a WMS service. This is pretty cool but what I’d expect most developers want is the ability to display WMS layers directly in a GMap instance in the browser. Fortunately, this is not too difficult if we base a WMS map spec on the existing Street Map spec and then manipulate the URL returned for each map tile. IMO, this opens up a lot more data for use in simple GMaps applications.

UPDATE (3/27/06) - There is a better working version for Google Maps V2 here: http://johndeck.blogspot.com/

Download the WMSSpec code (updated to version 0.4)

UPDATE - Based on feedback, I changed the spec a bit. You don't have to pass in a base spec anymore and the shortname, version, copyright, SRS, BackgroundColor and Transparency values can now be optionally set in the constructor. Also, you can set the OverlaySpec property to any map spec you want and it will use the new GM overlay code. YMMV.

UPDATE 2 (8/9/05) - One quick change, when the Spec you use for your overlay already has an overlay (e.g. Hybrid), it now uses the overlay instead of the base spec. This allows you to put the Hybrid streets over any WMS layer

New Example for 0.4:
var wms = new WMSSpec("http://wms.jpl.nasa.gov/wms.cgi?", "WMS Test", "WMS", "modis", "default", "image/jpeg", "NASA 2005");
wms.OverlaySpec = map.mapTypes[2];     //Hybrid map streets


Example:
var wms = new WMSSpec(mapTypes[0], "http://wms.jpl.nasa.gov/wms.cgi?", "WMS Test", "modis", "default", "image/jpeg" );
Either add this to your array of specs passed to the GMap constructor or use the undocumented access to the array itself. (MyGMap.mapTypes[MyGMap.mapTypes.length] = wms;)

WMSSpec(baseSpec, baseURLtoWMSServer, name, layer, style, format);
1) the Google Maps Streets spec, usually the first spec in the array but it is also pointed to by the G_MAP_TYPE and _GOOGLE_MAP_TYPE variables
2) The URL to the WMS Server, don’t forget the “?” at the end
3) Name of service, used for labeling
4) Layer – the WMS layer name to use. This parameter is passed in whole to the server so it will accept whatever the WMS server is expecting
5) Style – the WMS style to use. See 4.
6) Format – the image format to return. (e.g. image/png, image/jpeg etc.)

 
使用API接口实现WMS系统和物流系统的数据交互是一种常见的方式,下面是一些具体的实现步骤: 1. 定义API接口:在WMS系统和物流系统中分别定义API接口,包括接口名称、请求参数、响应参数等内容。在定义API接口时,需要考虑接口的安全性、可靠性、可扩展性等方面。 2. 实现API接口:在WMS系统和物流系统中分别实现API接口,对请求参数进行校验、数据转换等处理,然后调用后台服务进行业务处理,并将处理结果封装成响应参数返回给调用方。 3. 注册API接口:在WMS系统和物流系统中分别注册API接口,将接口的URL地址、请求方式、请求参数、响应参数等信息注册到API管理平台中。 4. 调用API接口:在WMS系统和物流系统中分别调用API接口,将请求参数按照接口定义的格式封装成HTTP请求,然后通过HTTP协议将请求发送给API管理平台。API管理平台对请求进行校验、转发等处理,然后将请求发送给目标系统的API接口。 5. 处理API请求:在物流系统中接收到WMS系统的API请求后,进行请求参数的校验、数据转换等处理,然后调用后台服务进行业务处理,并将处理结果封装成响应参数返回给WMS系统。在WMS系统中接收到物流系统的API请求后,进行类似的处理过程。 通过API接口实现WMS系统和物流系统的数据交互,可以提高系统之间的集成效率和可扩展性,同时也需要注意数据的安全性和可靠性问题。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值