如果您想要的是这样的:MapTilerLayer(或overlay-simple),您可以使用动态url来渲染图像并将其设置为叠加层的源图像。
来自 Google 地图 Javascript API 的示例:
function initialize() {
var mapOptions = {
zoom: 11,
center: new google.maps.LatLng(62.323907, -150.109291),
mapTypeId: google.maps.MapTypeId.SATELLITE
};
var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
var swBound = new google.maps.LatLng(62.281819, -150.287132);
var neBound = new google.maps.LatLng(62.400471, -150.005608);
var bounds = new google.maps.LatLngBounds(swBound, neBound);
// THE DYNAMIC IMAGE URL
var srcImage = 'http://your.url/image.ashx';
// The custom USGSOverlay object contains the USGS image,
// the bounds of the image, and a reference to the map.
overlay = new USGSOverlay(bounds, srcImage, map);
}
Run Code Online (Sandbox Code Playgroud)