-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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
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.
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>
Hi andij62,
I've post an issue to google code: http://code.google.com/p/zkgmapsz/issues/detail?id=21
Regards,
Ben
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");
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
Asked: 2012-10-19 10:41:57 +0800
Seen: 164 times
Last updated: Apr 18 '14