var PixelkarteType = new google.maps.ImageMapType({
isPng: true,
maxZoom: 20,
minZoom: 7,
opacity: 0.8,
name: "Landeskarte",
tileSize: new google.maps.Size(256, 256),
credit: 'swisstopo',
getTileUrl: function(coord, zoom) {
var config = {
service: "http://proxy-wxs.ign.fr/url/http:/api.geo.admin.ch/main/mapproxy/service?",
layers: "ch.swisstopo.pixelkarte-farbe",
extension: "jpeg"
};
var url = WMSGetTileUrl(coord, zoom, config);
return url;
}
});
function WMSGetTileUrl(coord, zoom, config) {
var proj = map.getProjection();
var zfactor = Math.pow(2, zoom);
var top = proj.fromPointToLatLng(new google.maps.Point(coord.x * 256 / zfactor, coord.y * 256 / zfactor));
var bot = proj.fromPointToLatLng(new google.maps.Point((coord.x + 1) * 256 / zfactor, (coord.y + 1) * 256 / zfactor));
var bbox = top.lng() + "," + bot.lat() + "," + bot.lng() + "," + top.lat();
var url = config.service + "LAYERS={0}&FORMAT=image/{1}&SRS=EPSG:4326&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap" + "&STYLES=&BBOX={2}&WIDTH=256&HEIGHT=256";
url = url.format(config.layers, config.extension, bbox);
return url;
}
--
You received this message because you are subscribed to the Google Groups "GeoAdmin API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geoadmin-api...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "GeoAdmin API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geoadmin-api...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.