[Spanish] personalizar OpenLayers

Ahmed Rodriguez Pando ahmedrp at gmail.com
Wed Aug 19 16:54:37 EDT 2009


Hola lista en [1] tengo un ejemplo de openlayers con OSM como mapa base.
Hasta ahí todo muy bien. He intentado ya de varias formas pero ninguna
satisfactoria en lograr cambiar las imágenes de la barra de zoom y demás que
quedan a la derecha. Si alguien tiene alguna receta lo agradeceré

<head>
    <title>OpenStreetMap</title>
    <script src="http://www.openlayers.org/api/OpenLayers.js
<view-source:http://www.openlayers.org/api/OpenLayers.js>"></script>
    <script src="http://www.openstreetmap.org/openlayers/OpenStreetMap.js
<view-source:http://www.openstreetmap.org/openlayers/OpenStreetMap.js>"></script>
    <style type="text/css">
        #map {
            width: 100%;
            height: 80%;
            border: 1px solid black;
        }
        .olPopupContent{}
        .olLayerGeoRSSClose{}
        .olLayerGeoRSSTitle{}
        .olLayerGeoRSSDescription{}


    </style>

    <script type="text/javascript">
        var lon = -82.34872;
		var lat = 23.13815;
		var zoom = 15;
				
		var markers = new OpenLayers.Layer.Markers( "Markers" );
        var size = new OpenLayers.Size(15,15);
        var offset = new OpenLayers.Pixel(-(size.w/2), -(size.h/2));
        var icon = new OpenLayers.Icon('Trust.png',size,offset);

        var map;

        function init() {
            map = new OpenLayers.Map ("map", {
                controls:[
                    new OpenLayers.Control.Navigation(),
                    new OpenLayers.Control.Attribution(),
                    new OpenLayers.Control.Permalink(),
                    new OpenLayers.Control.ScaleLine(),
                    new OpenLayers.Control.PanZoomBar()
                    ],
                maxExtent: new
OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),
                projection: new OpenLayers.Projection("EPSG:4326"),
                units: 'm',
                numZoomLevels: 19,
                maxResolution: 'auto'
            } );

            Mapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik",
{opacity : 0.75});


           	hotels = new OpenLayers.Layer.GeoRSS( 'Hotels',
'hoteles.xml',{'icon':icon});
           	pb_wms = new OpenLayers.Layer.WMS( "edicficios",
"http://sit.ohc.cu/cgi-bin/mapserv?map=/home/mapfile/habows.map",
           					{layers: "manzanas,areas_verdes,edificios",
transparent: "true", format: "image/png", sld:
"http://sit.ohc.cu/osm/pinta.sld"},
                    {isBaseLayer : 0}
                  	);
            map.addLayers([Mapnik, pb_wms, hotels]);

            var lonLat = new OpenLayers.LonLat(lon,
lat).transform(map.projection, map.getProjectionObject());
            map.setCenter (lonLat, zoom);

        }

    </script>

</head>

<!-- body.onload is called once the page is loaded (call the 'init'
function) -->
<body onload="init();">

    <!-- define a DIV into which the map will appear. Make it take up
the whole window -->

    <div style="width:100%; height:100%" id="map"></div>
</body>

</html>


[1] http://sit.ohc.cu/ejemplos/GeoRSS/testosm_georss.htm


-- 
---------------------------------------------------------------------
Ahmed Rodríguez Pando
Lic. en Ciencias de la Computación.
---------------------------------------------------------------------
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: http://lists.osgeo.org/pipermail/spanish/attachments/20090819/928ef12c/attachment.html


More information about the Spanish mailing list