aytee / 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

Hardcoded http call for markerwithlabel #64

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The source code for markerwithlabel includes a hardcoded reference to the 
"cross" icon (drag_cross_67_16.png, see 
http://code.google.com/p/google-maps-utility-library-v3/source/browse/trunk/mark
erwithlabel/src/markerwithlabel.js#68).

The problem is, this ties the request for the image to the http protocol. When 
the plugin is used in a secure page (https), the calls to the "cross" image 
over http cause Internet Explorer to complain.

To reproduce the problem, simply visit with IE any map enhanced with the 
markerwithlabel plugin over https.

Expected result:
drag_cross_67_16.png should be loaded from http when the container webpage is 
loaded through http, and from https when the page is loaded through https.
More to the point, the protocol for loading the image should reflect the one 
used to load the markerwithlabel.js file.

Actual result:
The image is always loaded via an http request, which causes security warnings 
in https pages.

Version: 1.1 (but it's in HEAD as well, from what I see in the repository)

Browser / Operating System:
Internet Explorer

Original issue reported on code.google.com by simbul...@gmail.com on 9 Feb 2011 at 5:57

GoogleCodeExporter commented 9 years ago
Hmmm. I may have to add a parameter you can use to specify the protocol ("http" 
or "https") or perhaps a parameter to specify the name of the "cross" image 
(probably the latter).

Can anyone suggest a more elegant solution?

Original comment by garylitt...@gmail.com on 11 Jul 2011 at 4:27

GoogleCodeExporter commented 9 years ago
I added two new properties in the trunk version of MarkerWithLabel: crossImage 
and handCursor. This will allow you to specify https URLs for these images.

Original comment by garylitt...@gmail.com on 11 Jul 2011 at 5:51

GoogleCodeExporter commented 9 years ago
Fixed in the 1.1.5 tagged release.

Original comment by garylitt...@gmail.com on 11 Jul 2011 at 11:43

GoogleCodeExporter commented 9 years ago
Better fix:

opt_options.crossImage = opt_options.crossImage || "http"+('https:' == 
document.location.protocols ? "s" : 
"")+"://maps.gstatic.com/intl/en_us/mapfiles/drag_cross_67_16.png";
  opt_options.handCursor = opt_options.handCursor || "http"+('https:' == document.location.protocols ? "s" : "")+"://maps.gstatic.com/intl/en_us/mapfiles/closedhand_8_8.cur";

Original comment by h...@drkmap.de on 9 Jan 2012 at 6:55

GoogleCodeExporter commented 9 years ago
I've got the 1.1.5 release and this does not appear to be resolved. There are 
still two hard coded http:// links as far as I can tell.

http://code.google.com/p/google-maps-utility-library-v3/source/browse/trunk/mark
erwithlabel/src/markerwithlabel.js

Original comment by j0rd.s...@gmail.com on 26 Sep 2012 at 5:32

GoogleCodeExporter commented 9 years ago
Use the crossImage and handCursor properties to set appropriate values for the 
cursors. They are no longer hard coded. I do have a version that also 
incorporates Comment 4. Perhaps I will post it as a new 1.1.6 release.

Original comment by garylitt...@gmail.com on 26 Sep 2012 at 6:26