0

Gmaps - Tooltip does not work

asked 2012-10-19 10:41:57 +0800

andij62 gravatar image andij62
303 1 7

updated 2012-10-19 10:59:03 +0800

Hi all,

i use zk 6.5 and i will set a tooltip to gmarker and gpoly but it does not work. What am I doing wrong?

here is my code:

<zk>
<window id="mapWin" height="100%" width="100%" apply="map.MapCtrl">
	<script type="text/javascript" content="zk.googleAPIkey='myKey'"></script>
	<gmaps id="map" width="100%" height="100%" ></gmaps>
</window>
</zk>

	public void onCreate() throws Exception {
		map.panTo(50.752213, 10.437012);
		map.setZoom(6);
		
		Gmarker gmark = new Gmarker();
		gmark.setParent(map);
		gmark.setLat(47.698710);
		gmark.setLng(10.3276800);
		gmark.setTooltiptext("This is a tooltip for gmarker");

		Gpolygon gpoly = new Gpolygon();
		gpoly.setParent(map);
	        gpoly.addPoint(47.0,10.0,3);
	        gpoly.addPoint(47.0,10.5,3);
	        gpoly.addPoint(47.5,10.5,3);
	        gpoly.addPoint(47.5,10.0,3);
	        gpoly.addPoint(47.0,10.0,3);
	        gpoly.setTooltiptext("This is a tooltip for gpoly");
	}

Regards Andi

delete flag offensive retag edit

8 Replies

Sort by ยป oldest newest

answered 2012-10-19 12:31:01 +0800

Steva77 gravatar image Steva77 flag of Italy
1014 3
http://www.research.softe...

I was trying something on the sandbox, but with Chrome Version 22.0.1229.94 m when I update my test code I get a corrupted image (half the map is "grayed").
Take into consideration there is also a content for gmarker, if you mean the baloon you usually see in maps... see the example in the sandbox http://www.zkoss.org/zksandbox/#m8.

link publish delete flag offensive edit

answered 2012-10-19 16:33:32 +0800

andij62 gravatar image andij62
303 1 7

Hi Steva,

i do not mean the baloon! I mean the Mouseover-Effect without Klick.I set it with "setTooltiptext" but it does not work.

link publish delete flag offensive edit

answered 2012-10-19 19:56:04 +0800

andij62 gravatar image andij62
303 1 7

updated 2012-10-19 19:57:35 +0800

also the example of twiegand from this Link does not work!
Is also an additional eventListener required?

<zk>
	<window id="win" height="100%">
		<script src="http://www.google.com/jsapi?key=Your Google Maps Key"></script>
		
		<gmaps id="gm" height="100%" width="100%" showSmallCtrl="true" lat="40" lng="-3" zoom="17" mapType="satellite" scrollWheelZoom="true" showTypeCtrl="true"></gmaps>
				
		<zscript>
			Gmarker gmarker = new Gmarker();
			gmarker.setLat(40);
			gmarker.setLng(-3);

			Popup popup = new Popup();
			win.appendChild(popup);
			Vlayout vlayout = new Vlayout();
			Label labelLine1 = new Label("Your Multi-line");
			Label labelLine2 = new Label("popup content goes here");
			vlayout.appendChild(labelLine1);
			vlayout.appendChild(labelLine2);
			popup.appendChild(vlayout);
			gmarker.setTooltip(popup);
			
			gm.appendChild(gmarker);
		</zscript>
	</window>
</zk>

link publish delete flag offensive edit

answered 2012-10-21 08:57:00 +0800

andij62 gravatar image andij62
303 1 7

Any help please!

link publish delete flag offensive edit

answered 2012-10-22 17:00:52 +0800

twiegand gravatar image twiegand
1807 3

andij62,

My example still works fine in 5.x so perhaps something has changed in 6.  Sorry for the inconvenience.

Todd

link publish delete flag offensive edit

answered 2012-10-23 07:40:51 +0800

benbai gravatar image benbai
2228 6
http://www.zkoss.org

Hi andij62,

I've post an issue to google code: http://code.google.com/p/zkgmapsz/issues/detail?id=21

Regards,
Ben

link publish delete flag offensive edit

answered 2013-07-17 03:35:50 +0800

benbai gravatar image benbai
2228 6
http://www.zkoss.org

as a workaround, you can override gmarker as below:

gmark.setWidgetOverride("initMapitem_", "function() {\n"
+"      this.$initMapitem_();\n"
+"      this.mapitem_.setTitle('This is a tooltip for gmarker');\n"
+"      }\n");
link publish delete flag offensive edit

answered 2014-04-18 14:58:11 +0800

Steva77 gravatar image Steva77 flag of Italy
1014 3
http://www.research.softe...

Hi guys!
Trying out ZK7:

<gmaps id="mymap" 
    lat="44.4138933" 
    lng="8.9229114" 
    zoom="17" 
    mapType="satellite" width="100%">

    <gmarker id="darsena_marker" 
        lat="44.4140828" 
        lng="8.9223603"
        tooltiptext="This should be tooltiptext">
        <attribute name="content">
            <![CDATA[ This is content ]]>
        </attribute>
    </gmarker>

</gmaps>

The tooltip still does not work...
Cheers,
Stefano

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2012-10-19 10:41:57 +0800

Seen: 162 times

Last updated: Apr 18 '14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More