ThinkGeo.com    |     Documentation    |     Premium Support

WebAPI Overlays help

I’m just starting with the WebAPI version and downloaded the Overlays code sample to basically test out. Is there a link or something that will help me with creating overlays. In the code sample that I’m working on, in the thinkgeo.js file, I see where I can change the bingMapLayer imagerSet from Aerial/Road/etc. How can I do something similar with the googleMapLayer and openStreetMapLayer to change from a road map view to an aerial or vise versa.

// Bing
var bingMapLayer = new ol.layer.Tile({
source: new ol.source.BingMaps({
key: bingMapsKey,
imagerySet: ‘AerialWithLabels’ // Aerial, AerialWithLabels, Birdseye, BirdseyeWithLabels, Road
}),
visible: false
});

// Google
var googleMapLayer = new ol.layer.Tile({
source: new ol.source.XYZ(({
urls: [‘http://mt0.google.com/vt/lyrs=m&x={x}&y={y}&z={z}’,
http://mt1.google.com/vt/lyrs=m&x={x}&y={y}&z={z}’,
http://mt2.google.com/vt/lyrs=m&x={x}&y={y}&z={z}’,
http://mt3.google.com/vt/lyrs=m&x={x}&y={y}&z={z}’, ]
})),
visible: false
});

// Open Street Maps
var openStreetMapLayer = new ol.layer.Tile({
source: new ol.source.OSM({
attributions: [
new ol.Attribution({
html: 'All maps © ’ +
OpenStreetMap
}),
ol.source.OSM.ATTRIBUTION
]
}),
visible: false
});

Hi Chad,

Thanks for evaluating Map Suite products, The purpose of WebApiEdition is used to provide a very simple and straight-forward way to set up a REST service based API to let us consume it from client side, such as OpenLayers, Leaflets and others.

Based on the demo code you provided, I guess you are looking into the client side demo based on OpenLayers3, you can check details at http://openlayers.org/ , there you can get the detailed documentation and sanples. Actually, the BingMaps overlay is different from the Google and OSM, for the later 2, you need to reset the URLs and call “refresh” function to make it work.

Hope it helps.

Thanks,
Johnny