[OpenLayers-Users] Using Yahoo Layer with Mapserver Layer
Matthew Pettis
matthew.pettis at gmail.com
Thu Jun 26 17:54:49 EDT 2008
Hi,
I'm trying to add a Yahoo baselayer to my map so that I may toggle between
layers. My code is below. The mapserver layer renders correctly (state of
Minnesota in gray), but when I try to toggle to the Yahoo layer, I get
something that has a scale and Yahoo info at the bottom of the image, but
the whole rest of the image is just gray. Can someone help me figure out
how to make these things integrate? The webpage code is below.
Thanks,
Matt
================================================
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Example</title>
<!-- <script src="http://www.openlayers.org/api/OpenLayers.js"></script>
-->
<script src="http://localhost/_common//OpenLayers-2.6/OpenLayers.js
"></script>
<script src="
http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=euzuro-openlayers"></script>
<script type="text/javascript">
var map = null;
function init(){
map = new OpenLayers.Map(
'map',
{
maxResolution: 'auto'
, maxExtent: new
OpenLayers.Bounds(184056.505,4809728.25,767381.245,5478975.75)
, units: 'm'
, projection: "EPGS:26915"
}
);
var ol_ms = new OpenLayers.Layer.MapServer(
"Mapserver Untiled"
, "
http://localhost/cgi-bin/mapserv.exe?map=C:\\ms4w\\Apache\\htdocs\\ol\\map.map
"
, {layers: 'state'}
, {singleTile: true}
);
map.addLayer(ol_ms);
var yahoo = new OpenLayers.Layer.Yahoo(
"Yahoo"
);
map.addLayer(yahoo);
map.zoomToMaxExtent();
map.addControl(new OpenLayers.Control.LayerSwitcher());
}
</script>
</head>
<body onload="init()">
<div id="map" class="smallmap" style="width:400;height:300"></div>
</body>
</html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20080626/81c46d3d/attachment.html
More information about the Users
mailing list