[OpenLayers-Dev] Bing Maps with Custom Tile Server

telavitic millerm2 at gmail.com
Sat Feb 11 16:39:59 EST 2012


I need to get bing maps displayed and add an overlay on top of that which
would be images from our tile server.  Tried for 4 hours and still no luck,
tried 2 different things and neither would work.

When I add the Bing Map and Our Tile server as base maps (Want the tile
server to be overlay but just testing to get it work, thought might help get
it to work as overlay) when switching basemaps via layer switcher it
throughs the map way off, I had my tile server set for china and when I
switched to bing I was off in the ocean near africa.  I think it might be
projection but can't figure it out.

When I have bing maps as base map and tile server as overlay it is checked
however its grey and appears disabled (can't check/uncheck it) not to
mention its not displayed on map.

Any help would be appreciated, at least point me in the right direction. 
Working extra weekend hours trying to get this done, hopefully I could get a
response quickly.

FYI:  Code is the same for both issues above, I just change isBaseLayer to
true or false.

**********Code Below******
map = new OpenLayers.Map('mapDiv',{projection: new
OpenLayers.Projection("EPSG:900913"),
					units: "m", displayProjection: new
OpenLayers.Projection("EPSG:4326")});
			
map.addControl(new OpenLayers.Control.LayerSwitcher());

            road = new OpenLayers.Layer.Bing({
                name: "Road",
                key: apiKey,
                type: "Road"
            });
           
            aerial = new OpenLayers.Layer.Bing({
                name: "Aerial",
                key: apiKey,
                type: "Aerial"
            });

			var aliasproj = new OpenLayers.Projection("EPSG:4326");

			var tsurl =
"http://www.customtileserverurl.com/MapTileServer/api.svc/ts";
			var MapName = "BaseMap";
		
			mi_Base = new OpenLayers.Layer.MapInfoRESTHandler("Routefinder", tsurl,
                         { mapname: MapName, output: 'image/png', tileType:
'MBR' },
                         { isBaseLayer: false, buffer: 1, transitionEffect:
'resize', numZoomLevels: 20 });
			
			mi_Base.projection =  aliasproj;
			
			map.addLayers([road, aerial,mi_Base]);

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Bing-Maps-with-Custom-Tile-Server-tp4460731p4460731.html
Sent from the OpenLayers Dev mailing list archive at Nabble.com.


More information about the Dev mailing list