javascript - Google Maps API infoWindowAnchor not working? -


I'm trying to get information to show Windows in the right place on a Google Map integration (Just above the top left / top left corner of an image) whenever I try to adjust "InfoWindowAnchor", does not it work? However, "icon anchor" works as expected, I'm wondering if anyone has ever participated in similar situations? I'm using a custom icon, but even when I return to the standard icon provided by Google, infoWindow incorrectly (as it focuses on tail icon opposed to being placed in the upper right Position is being displayed).

Below I am using code to do all this work code is important bits here, but I have removed some other functions that may come in your way when diagnosing.

  $ (document) .ready (function () {var centerLatitude = 37.782112; var centerLongitude = -122.4,1 9, 281; var sanFran = new GLatLng (centerLatitude, centerLongitude); var startZoom = 12; var map; var icon; // our tuberent image bridesmaid myIcon = new GIcon creates a default icon using (); myIcon.image = baseurl + 'my / imageFolder / markerFolder / image.png'; myIcon .shadow = baseurl + 'my / imageFolder / markerFolder / shadow.png'; myIcon.iconSize = GSize new (25,25); MyIconkshadowSize = GSize new (38,25); MyIconkiconAnchor = new GPoint (13, 25); myIcon.infoWindowAnchor = new GPoint (13,0); myIcon.printImage = baseurl + 'my / imageFolder / markerFolder / printImage.gif'; myIcon .mozPrintImage = baseurl + 'my / imageFolder / markerFolder / mozPrintImage .gif '; myIcon.printShadow = baseurl +' my / imageFolder / markerFolder / printShadow.gi f '; MyIcon.transparent = baseurl +' my / imageFolder / Markrfolder / transparent ''; MyIcon.imageMap = [22,0,22 , 1,22,2,21,3,21,4,21,5,21,6,21,7,23,8,24,924,10,22,11,22,12,22,13 , 22,14,22,15,22,16,22,17,22,18,22,19,22,20,22,21,22,22,22,23,22,24,2,24,1 , 23,122,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,14,1,1,1,1,12,1,11 , 0,10,0,9,1,8,3,7,4,6,5,5,7,4,8,3,9,2,10,1,111]; Map = new GMap2 (document.getElementById ('map')); Map.addControl (new GMapTypeControl ()); Map.addControl (new GLargeMapControl3D ()); Map.setCenter (sanFran, startZoom); / * Some random codes and functions are here .... * / var point = new.lat, location.lng); Var marker = new GM marker (point, iiCon); Map.addOverlay (marker); / * Some random code and functions here .... * / GEvent.addListener (marker, "click", function () {var randomText = "some random test text"; var myHtml = "& lt; b & gt; # "+ Location.id +"  
"+ location.neighborhood +"
"+ randomText; map.openInfoWindowHtml (point, myHtml) );}); }); $ (Document.body). Unload (function () {if (GBrowserIsCompatible ()) {GUnload ();}});

You can also try settings ().

Do you take everyone into the info window?

Otherwise, I suspect that this is the answer, but I'll just try it in the matter. From:

From: "When we have created a map through the GMAP 2 constructor, we have to initialize it. This initialization is accomplished using the set center () method of the map. The SetCenter () method requires a GLTLNG coordination and a zoom level and this method should be sent before any other operation on the map, including the other properties of the map. Interpretation involves. "

You are adding some control before calling setCenter ().


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -