我是新来的JS和谷歌地图API ...我获得了一些JS代码,希望显示WMS,我在谷歌地图引擎创建的。
作为WMS似乎没有显示任何东西我都卡住了与下面的代码。
当我迷路是针对谷歌地图引擎WMS和“层”变量,我使用的资产ID为这一特定地图的基本URL。 我在这儿住丢失,并且希望得到任何帮助。
function WMSGetTileUrl1(tile, zoom) {
var projection = window.mapA.getProjection();
var zpow = Math.pow(2, zoom);
var ul = new google.maps.Point(tile.x * 256.0 / zpow, (tile.y + 1) * 256.0 / zpow);
var lr = new google.maps.Point((tile.x + 1) * 256.0 / zpow, (tile.y) * 256.0 / zpow);
var ulw = projection.fromPointToLatLng(ul);
var lrw = projection.fromPointToLatLng(lr);
//The user will enter the address to the public WMS layer here. The data must be in WGS84
var baseURL = "https://mapsengine.google.com/17306057122701807517-17234028967417318364-4/wms/?";
var version = "1.1.1";
var request = "GetMap";
var format = "image/jpeg"; //type of image returned or image/jpeg
//The layer ID. Can be found when using the layers properties tool in ArcMap
var layers = "17306057122701807517-17234028967417318364";
var srs = "EPSG:4326"; //projection to display. This is the projection of google map. Don't change unless you know what you are doing.
var bbox = ulw.lng() + "," + ulw.lat() + "," + lrw.lng() + "," + lrw.lat();
//the size of the tile, must be 256x256
var width = "256";
var height = "256";
var styles = "default";
//Establish the baseURL.
var url = baseURL + "version=" + version + "&request=" + request + "&Layers=" + layers + "&Styles=" + styles + "&SRS=" + srs + "&BBOX=" + bbox + "&width=" + width + "&height=" + height + "&format=" + format;
return url;
}