zahidsw / google-maps-utility-library-v3

Automatically exported from code.google.com/p/google-maps-utility-library-v3
Apache License 2.0
0 stars 0 forks source link

RichMarker non-compiled behaves wrong, compiled works fine. #146

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Demo link or sample code:
[Enter the URL pointing to a simple demo which clearly reproduces the bug,
or insert code snippet]

<!DOCTYPE html>
<html>
<head>
   <meta http-equiv="content-type" content="text/html; charset=utf-8" />
   <title>Rich Marker</title>
   <style type="text/css">
      #map { width: 600px; height: 400px; float: left; margin: 0 5px;}
      .my-other-marker { background: blue; border: 2px solid #fff; padding: 3px; }
   </style>
   <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
   <script type="text/javascript" src="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/richmarker/src/richmarker.js"></script>
   <script type="text/javascript">
      var map;
      var marker2, marker3;
      function init() {
         var mapCenter = new google.maps.LatLng(0, 0);
         map = new google.maps.Map(document.getElementById('map'), { zoom: 1, center: mapCenter, mapTypeId: google.maps.MapTypeId.ROADMAP});
         var div = document.createElement('DIV');
         div.innerHTML = '<div class="my-other-marker">I am flat marker!</div>';
         marker2 = new RichMarker({map: map, position: new google.maps.LatLng(30, 50), draggable: true, flat: true, anchor: RichMarkerPosition.MIDDLE, content: div});
         var marker3 = new google.maps.Marker({position:mapCenter, draggable:true, raiseOnDrag:false, title:"test", icon:'http://farm4.static.flickr.com/3212/3012579547_097e27ced9_m.jpg'});
         marker3.setMap(map);
      }
      google.maps.event.addDomListener(window, 'load', init);
   </script>
</head>
<body>
   <div id="map"></div>
</body>
</html>

What steps will reproduce the problem?
1.use non-compiled version of richmarker.js as above
2.add a regular Marker and a richmarker to a map where the two overlap
3.try dragging the richmarker. compare that behavior to the compiled version of 
richmarker-compiled.js

Expected result:
[Describe what you expected to happen]
when a richmarker and regular Marker overlap, if the richmarker is visibly on 
top of the regular Marker, the rich marker should be draggable.

Actual result:
[Describe what actually happened]
if using the non-compiled version of richmarker.js, when a richmarker is 
visibly on top of a regular marker, you cannot drag the richmarker.  attempting 
to drag the richmarker drags the regular Marker below it instead.  However it 
works fine with richmarker-compiled.js.  there should be no difference in 
behavior using either the compiled or non-compiled version of the script.
Version: ###

Browser / Operating System:
[e.g. FF3 / MacOSX]

Tested in Chrome 15, FF7, IE9 on Win7, same result on all.

Additional comments:
[Enter any additional comments about the bug here.]

*********************************************************
Tip: Star this issue (next to title) to receive notifications of status
changes against this issue, also used as a gauge for how many people are
interested in seeing it resolved.
*********************************************************

Original issue reported on code.google.com by ryanag...@gmail.com on 3 Dec 2011 at 1:47

GoogleCodeExporter commented 9 years ago
The "working" source used to produce richmarker-compiled.js must be different 
than that currently in richmarker.js.  To test I compiled the current 
richmarker.js with the closure compiler and the richmarker still misbehaves.  
But richmarker-compiled.js works just fine so I have to assume the source used 
to produce it is somehow different.  Any way to as the contributor of 
richmarker-compiled.js to update richmarker.js with the source used for 
richmarker-compiled.js?

Original comment by ryanag...@gmail.com on 5 Dec 2011 at 4:40

GoogleCodeExporter commented 9 years ago
Problem found.  On line 732 of richmarker.js, overlayMouseTarget should instead 
be overlayImage.  richmarker-compiled.js uses overlayImage for the 
corresponding statement in the compiled version, not sure why there is a 
difference between the two.

Original comment by ryanag...@gmail.com on 5 Dec 2011 at 7:18