windrobin / gmapcatcher

Automatically exported from code.google.com/p/gmapcatcher
0 stars 0 forks source link

Overflow error /svn/trunk/wmap/map.html #299

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
http://gmapcatcher.googlecode.com/svn/trunk/wmap/map.html

 in windows xp pro sp3 but works fine in windows 7,
However if I access directly to your IP http://ipmia.dyndns.org/ is working 
properly.

I have extracted the code directly from your http://ipmia.dyndns.org/
 and works well on both XP and Windows 7 also locally

<!doctype html>
<html lang=es>
<meta charset=utf-8>
  <title>MAPA DE LA TIERRA EN FORMATO OSM ZOOM 17 A 7 (BURGOS ZOOM 17 A -3)</title>

  <script src="http://maps.google.com/maps/api/js?v=3.5&amp;sensor=false&language=en"></script>
  <script src="http://ipmia.dyndns.org/OpenLayers.js"></script>
  <script>

    window.onload=inicializaMapa;
    function inicializaMapa() {
       //CONFIGURA EL MAPA
      map = new OpenLayers.Map("map",{
          controls: [
                    new OpenLayers.Control.Navigation(),
                    new OpenLayers.Control.PanZoomBar(),
                    new OpenLayers.Control.LayerSwitcher({'ascending':true}),
                    new OpenLayers.Control.Permalink('permalink'),
                    new OpenLayers.Control.ScaleLine(),
                    new OpenLayers.Control.MousePosition(),
                    new OpenLayers.Control.KeyboardDefaults()
                    ],

                maxExtent: new OpenLayers.Bounds(-180, -90, 180, 90),
                minExtent: new OpenLayers.Bounds(-1, -1, 1, 1),

                maxResolution: "auto",
                minResolution: "auto",

                numZoomLevels: 22,

                units: 'm',
                displayProjection: new OpenLayers.Projection("EPSG:4326")
                               });

       //IMAGEN DE ERROR
    OpenLayers.Util.OSM = {};
    OpenLayers.Util.OSM.TILE_404 = "http://ipmia.dyndns.org/img/404.png";
    OpenLayers.Util.OSM.originalOnImageLoadError = OpenLayers.Util.onImageLoadError;
    OpenLayers.Util.onImageLoadError = function() {this.src = OpenLayers.Util.OSM.TILE_404;};

     //PONE LAS CAPAS DE LOS MAPAS DE GOOGLE
           var gmap = new OpenLayers.Layer.Google("Carreteras (En Google Usando API)",
                      {numZoomLevels: 22, visibility: true});

           var gphy = new OpenLayers.Layer.Google("Relieve (En Google Usando API)",
                      {type: google.maps.MapTypeId.TERRAIN,
                      numZoomLevels: 16, visibility: true});

           var gsat = new OpenLayers.Layer.Google("Satelite (En Google Usando API)",
                      {type: google.maps.MapTypeId.SATELLITE,
                      numZoomLevels: 22, visibility: true});

           var ghyb = new OpenLayers.Layer.Google("Hibrido (En Google Usando API)",
                      {type: google.maps.MapTypeId.HYBRID,
                      numZoomLevels: 22, visibility: true});

       map.addLayers([gmap, gphy, gsat, ghyb]);

//PONE LAS CAPAS DE LOS MAPAS DE GOOGLE SI HACER USO DE LA API
         var gmapnoapi = new OpenLayers.Layer.OSM("Carreteras (En Google Si Usar API)",
                         "http://mt2.google.com/vt//lyrt=m&hl=en&x=${x}&y=${y}&z=${z}",
                          {numZoomLevels: 23, isBaseLayer: true, visibility: true});

         var gphynoapi = new OpenLayers.Layer.OSM("Relieve (En Google Si Usar API)",
                         "http://mt2.google.com/vt/lyrs=p&hl=en&x=${x}&y=${y}&z=${z}",
                          {numZoomLevels: 16, isBaseLayer: true, visibility: true});

         var gsatnoapi = new OpenLayers.Layer.OSM("Satelite (En Google Si Usar API)",
                         "http://mt2.google.com/vt/lyrs=s&hl=en&x=${x}&y=${y}&z=${z}",
                         {numZoomLevels: 23, isBaseLayer: true, visibility: true});

         var ghybnoapi = new OpenLayers.Layer.OSM("Hibrido (En Google Si Usar API)",
                         "http://mt2.google.com/vt/lyrs=h&hl=en&x=${x}&y=${y}&z=${z}",
                         {numZoomLevels: 23, isBaseLayer: false, visibility: false});
        map.addLayers([gmapnoapi, gphynoapi, gsatnoapi, ghybnoapi]);

       //PONE CAPAS DE LOS MAPAS LOCALES
      var carreteras = new OpenLayers.Layer.OSM("Carreteras (En Mi Servidor)", 
                       "http://ipmia.dyndns.org/tiles/${z}/${x}/${y}.png",
                       {numZoomLevels: 23, isBaseLayer: true, visibility: true});

         var relieve = new OpenLayers.Layer.OSM("Relieve (En Mi Servidor)", 
                       "http://ipmia.dyndns.org/ter_tiles/${z}/${x}/${y}.png",
                       {numZoomLevels: 16, isBaseLayer: true, visibility: true});

        var satelite = new OpenLayers.Layer.OSM("Satelite (En Mi Servidor)", 
                       "http://ipmia.dyndns.org/sat_tiles/${z}/${x}/${y}.png",
                       {numZoomLevels: 23, isBaseLayer: true, visibility: true});

         var hibrido = new OpenLayers.Layer.OSM("Hibrido (En Mi Servidor)", 
                       "http://ipmia.dyndns.org/hyb_tiles/${z}/${x}/${y}.png",
                       {numZoomLevels: 23, isBaseLayer: false, visibility: false});
      map.addLayers([carreteras, relieve, satelite, hibrido]);

       //PONE MARCAS DESDE UN FICHERO DE TEXTO
           var marcas = new OpenLayers.Layer.Text( "Mis Marcas",
                        {location:"http://ipmia.dyndns.org/marcas.txt", visibility: true});
            var toros = new OpenLayers.Layer.Text( "Toros De Osborne",
                        {location:"http://ipmia.dyndns.org/toros.txt", visibility: true});
       map.addLayers([marcas, toros]);

       //PONE RUTAS DESDE UN FICHERO KML
          var verkml = new OpenLayers.Layer.Vector("Ver Rutas De Archivo KLM",

                         {projection: map.displayProjection,

                          strategies: [new OpenLayers.Strategy.Fixed()],

                            protocol: new OpenLayers.Protocol.HTTP(
                                      {url: "http://ipmia.dyndns.org/va-llanes.kml",
                                      format: new OpenLayers.Format.KML(
                                      {extractStyles: true, extractAttributes: true})}), visibility: true});
           map.addLayer(verkml);

       //MUESTRA INFORMACION DE LOS ATRIBUTOS DE UN FICHERO KML
            select = new OpenLayers.Control.SelectFeature(verkml);

            verkml.events.on({"featureselected": onFeatureSelect,
                              "featureunselected": onFeatureUnselect});
            map.addControl(select);
            select.activate();   

        function onPopupClose(evt) {
            select.unselectAll();
        }
        function onFeatureSelect(event) {
            var feature = event.feature;
            var selectedFeature = feature;
            var popup = new OpenLayers.Popup.FramedCloud("chicken", 
                feature.geometry.getBounds().getCenterLonLat(),
                new OpenLayers.Size(100,100),
                "<h2>"+feature.attributes.name + "</h2>" + feature.attributes.description,
                null, true, onPopupClose
            );
            feature.popup = popup;
            map.addPopup(popup);
        }
        function onFeatureUnselect(event) {
            var feature = event.feature;
            if(feature.popup) {
                map.removePopup(feature.popup);
                feature.popup.destroy();
                delete feature.popup;
            }
        };

       //VISUALIZA EL MAPA CON ESTAS COORDENADAS INICIALES
       //Google.v3 usa EPSG:900913 como projection, asi que 
       //tenemos que transformar nuestras coordenadas
            var lonLat = new OpenLayers.LonLat(-2.65, 39.55).transform(
                         new OpenLayers.Projection("EPSG:4326"),  // de WGS 1984
                          map.getProjectionObject());  // a Mercator Esferico
            var zoom = 6;  //Zoom Inicial del mapa
            map.setCenter(lonLat, zoom);
    }
  </script>

  <style>
            html, body {
                   height: 100%;
                   width: 100%;
                   margin: 0;
                   padding: 0;
                       }

            #map       {
                   position: absolute;
                   width: 100%;
                   margin: 0px;
                   top: 0em;
                   padding: 0;
                   bottom: 0px;
                                   <!-- border: 1px solid black; -->
                       }

            h1         {
                   font-size:1.5em;
                   font-weight:bold;
                   position: absolute;
                   top: 1em;
                   left: 1em;
                   padding:0em;
                   margin: 0px;
                       }

                        #permalink {
                                   position:absolute;
                                   margin-left:522px;
                                   }

      .olControlLayerSwitcher .layersDiv{
                                        background-color:#00008B;
                                        padding: 0.5em;
                                        color: white;
                                        }

        .olControlLayerSwitcher div,.olControlLayerSwitcher div span {
                                                                 background: #00008B;
                                                                     opacity: 0.95;
                                                                     color: white;
                                                                     font-weight: bold;
                                                                     font-size: 100%;
                                                                     }

      .olControlLayerSwitcher {
                  right: 0px;
                              }

      .olControlLayerSwitcher .maximizeDiv,.olControlLayerSwitcher .minimizeDiv{
                                                                               top: 10px;
                                                                               right: 0px;
                                                                               }
      .olControlAttribution {
                            bottom: 0px;
                            right: 0px;
                            }

      div.olControlMousePosition {
                                 font-weight: bold;
                                 font-family: Times;
                                 font-size: 1em;
                                 color: black;
                                 }

      div.olControlScaleLine {
                             font-family: Times;
                             font-size: 0.75em;
                             color: black;
                             font-weight: bold;
                             }

      .olLayerGoogleCopyright {display: none;}
      .olLayerGooglePoweredBy {display: none;}

    </style>

<!-- <h1>MAPA DE LA TIERRA EN FORMATO OSM ZOOM 17 A 7 (BURGOS ZOOM 17 A 
-3)</h1> -->
<!--   <body onload="initializeMap();"> -->
    <div id="map"></div>
  </body>
</html>

Original issue reported on code.google.com by madelein...@gmail.com on 17 Dec 2011 at 8:37

Attachments:

GoogleCodeExporter commented 8 years ago
 wmap was an example/experiment, this was a web page and it does not matter if is XP or Win7, and I did not get any errors when I test it.

Since this has nothing to do with GMapCatcher I removed that code.

Original comment by heldersepu on 20 Dec 2011 at 1:27