[OpenLayers-Users] Bug in Google with overaly example

Rodolfo Moreno rodolfoamoreno at gmail.com
Tue Aug 18 16:40:22 EDT 2009


Hi Cris, 
My issue is overlapping Google with MAPGUIDE layer and I think that is the
same issue that shows up in the openlayers sample. unfortunally I don't have
any public IP for showing my problem. However I have attached images in this
post in order to see my problem. Also I am posting the code of my sample
(ASPX part). This sample worked appropriately 3 months ago but now it does
not.

<%--<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">--%>

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>MapGuide & OpenLayers</title>
    
    <%--<link rel="stylesheet" href="map.css" type="text/css">--%>
    
    <style type="text/css">
        #map {
            width: 900;
            height: 400;
            border: 1px solid black;
            float:left;
        }
    </style>    

    <script
src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ'></script>
    
    <%--<script
src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAD3bxjYK2kuWoA5XU4dh89xRfZeWK0izhaDae8hGkNO-HuhO-8RRFiuF41wKrlmThr89nnlsf9WzWJA"
type="text/javascript"></script>--%>
    
    <script language="JavaScript"
src="http://www.openlayers.org/api/OpenLayers.js"></script>    
    
    <script type="text/javascript">

        var map, map2, layer;
        //var url =
"http://demo01.dmsolutions.ca/mapguide/mapagent/mapagent.fcgi";
        //you can use this URL when MapGuide OS is installed locally
		var url = "http://localhost/mapguide/mapagent/mapagent.fcgi";

        var metersPerUnit = 111319.4908;  //value returned from mapguide
        var inPerUnit = OpenLayers.INCHES_PER_UNIT.m * metersPerUnit;
        OpenLayers.INCHES_PER_UNIT["dd"] = inPerUnit;
        OpenLayers.INCHES_PER_UNIT["degrees"] = inPerUnit;
        OpenLayers.DOTS_PER_INCH = 96;
            

        function init(){
            
            var mapBounds = new OpenLayers.Bounds(-79.8022, -13.4355,
-73.74, -9.8448);
            var fixedScales =[9000000,5000000,2000000, 1000000, 578000,
289000, 144000, 72000, 36000, 18000, 9028 ];
            
            var  maxZOOMLEVEL = 19;
            
            var mapOptions = {
                maxExtent: mapBounds,            
                numZoomLevels: maxZOOMLEVEL+1
            };
			
            map = new OpenLayers.Map( 'map', mapOptions );
	var satellite = new OpenLayers.Layer.Google(
                "Google Satellite" , {type: G_NORMAL_MAP , MAX_ZOOM_LEVEL:
maxZOOMLEVEL}
            );
                        
            map.addLayer(satellite);
	//un-tiled versions
           var dynamicOverlayOptions = {
               buffer: 1,
              singleTile: true,
			       isBaseLayer : false,
			       visibility : true			  
	         };

			var untiledParams = {
			  	session: '<%=sessionId%>',
          mapname: 'Lima',
          transparent:'TRUE' // code added but without success                
			};

			var dynamicLayer = new OpenLayers.Layer.MapGuide(
"GetDynamicMapOverlayImage", 
				url, 
				untiledParams, 
				dynamicOverlayOptions );
			map.addLayer(dynamicLayer);
			
	        map.zoomToMaxExtent();

	        map.addControl(new OpenLayers.Control.MousePosition());
            map.addControl(new OpenLayers.Control.Scale());
			
    		var switcher=new OpenLayers.Control.LayerSwitcher();
			map.addControl(switcher);
			//switcher.maximizeControl();

        }
    </script>
  </head>
  <body onload="init()">
    <H2> Lima Map </H2>

    <div id="map" ></div>

	<br>

  </body>
</html>

Best Regards,


Christopher Schmidt-2 wrote:
> 
> On Tue, Aug 18, 2009 at 10:22:25AM -0500, Rodolfo Moreno wrote:
>> 
>> Hi Eric, do you realize that the overlay examples in
>> "http://openlayers.org/dev/examples/" is not working appropriately. Here
>> is
>> part of the example code for "google with overlay maps":
> 
> It's not working because 'world.freemap.in' is dead, kaput, etc. The 
> code should certainly work; can you provide an example where the 
> WMS server *does* exist and it doesn't work?
> 
> -- Chris
> 
>>   function init(){
>>             map = new OpenLayers.Map('map');
>> 
>>             var satellite = new OpenLayers.Layer.Google(
>>                 "Google Satellite" , {type: G_SATELLITE_MAP}
>>             );
>> 
>>             var wms = new OpenLayers.Layer.WMS(
>>                 "World Map",
>>                 "http://world.freemap.in/cgi-bin/mapserv",
>>                 {
>>                     map: '/www/freemap.in/world/map/factbooktrans.map',
>>                     transparent: 'TRUE',
>>                     layers: 'factbook'
>>                 },
>>                 {'reproject': true}
>>             );
>> 
>>             map.addLayers([satellite, wms]);
>> 
>>             map.setCenter(new OpenLayers.LonLat(10.205188,48.857593), 5);
>>             map.addControl( new OpenLayers.Control.LayerSwitcher() );
>>         }
>> 
>> In this code I can see what you are saying(transparent: 'TRUE') but this
>> sample is not working either.
>> maybe it's an openlayers issue.
>> 
>> Regards,
>> 
>> 
>> Eric Lemoine-2-2 wrote:
>> > 
>> > On Tuesday, August 11, 2009, Rodolfo Moreno <rodolfoamoreno at gmail.com>
>> > wrote:
>> >>
>> >> Thanks Eric for your answer. I am overlapping a mapguide layer. I did
>> >> what
>> >> you suggested but it's not working.
>> >>
>> >> var dynamicOverlayOptions = {
>> >>               buffer: 1,
>> >>               singleTile: true,
>> >>         isBaseLayer : false,
>> >>         visibility : true,
>> >>         transparent:true // This is the code added
>> >>                  };
>> >>
>> >> Is this property (transparent:true) new?
>> >> I ask about it because my sample works fine 3 months ago.
>> > 
>> > transparent is a WMS param. It should go in the Layer.WMS params, not
>> > options.
>> > 
>> > 
>> >>
>> >> Thanks in advance
>> >>
>> >>
>> >> Eric Lemoine-2-2 wrote:
>> >>>
>> >>> On Sat, Aug 8, 2009 at 12:35 AM, Rodolfo
>> >>> Moreno<rodolfoamoreno at gmail.com>
>> >>> wrote:
>> >>>>
>> >>>> Hi all,
>> >>>> The google with overlay example from
>> >>>> "http://openlayers.org/dev/examples/"
>> >>>> is working incorrectly. The bug is not only because the worldmap is
>> not
>> >>>> loaded correctly but also because this is covering whole the map and
>> >>>> thus
>> >>>> the google layer is not showed, just the worldmap is showed. if you
>> >>>> turn
>> >>>> off
>> >>>> the worldmap layer then it's possible to view the google layer. I
>> >>>> realized
>> >>>> about it because I have a similar example overlaping google maps
>> with
>> >>>> mapguide layers and 3 months ago this sample worked appropriately
>> (in
>> >>>> that
>> >>>> moment the last release was 2.6 version) and now I got the same bug,
>> it
>> >>>> means that mapguide layers covers whole map that don't enable to
>> view
>> >>>> the
>> >>>> google layers.
>> >>>
>> >>> The layer you put on top of the google layer must be transparent. If
>> >>> your layer if a WMS layer (OpenLayers.Layer.WMS) use transparent:true
>> >>> in the layer params.
>> >>>
>> >>>
>> >>> --
>> >>> Eric Lemoine
>> >>>
>> >>> Camptocamp France SAS
>> >>> Savoie Technolac, BP 352
>> >>> 73377 Le Bourget du Lac, Cedex
>> >>>
>> >>> Tel : 00 33 4 79 44 44 96
>> >>> Mail : eric.lemoine at camptocamp.com
>> >>> http://www.camptocamp.com
>> >>> _______________________________________________
>> >>> Users mailing list
>> >>> Users at openlayers.org
>> >>> http://openlayers.org/mailman/listinfo/users
>> >>>
>> >>>
>> >>
>> >>
>> >> -----
>> >> Rodolfo Moreno
>> >> CivilEng
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://n2.nabble.com/Bug-in-Google-with-overaly-example-tp3407076p3426344.html
>> >> Sent from the OpenLayers Users mailing list archive at Nabble.com.
>> >> _______________________________________________
>> >> Users mailing list
>> >> Users at openlayers.org
>> >> http://openlayers.org/mailman/listinfo/users
>> >>
>> > 
>> > -- 
>> > Eric Lemoine
>> > 
>> > Camptocamp France SAS
>> > Savoie Technolac, BP 352
>> > 73377 Le Bourget du Lac, Cedex
>> > 
>> > Tel : 00 33 4 79 44 44 96
>> > Mail : eric.lemoine at camptocamp.com
>> > http://www.camptocamp.com
>> > _______________________________________________
>> > Users mailing list
>> > Users at openlayers.org
>> > http://openlayers.org/mailman/listinfo/users
>> > 
>> > 
>> 
>> 
>> -----
>> Rodolfo Moreno
>> CivilEng
>> 
>> -- 
>> View this message in context:
>> http://n2.nabble.com/Bug-in-Google-with-overaly-example-tp3407076p3466693.html
>> Sent from the OpenLayers Users mailing list archive at Nabble.com.
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users
> 
> -- 
> Christopher Schmidt
> MetaCarta
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 
> 
http://n2.nabble.com/file/n3468479/OLforum2.jpg 

-----
Rodolfo Moreno
CivilEng

-- 
View this message in context: http://n2.nabble.com/Bug-in-Google-with-overaly-example-tp3407076p3468479.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list