Gpolyline"
From Documentation
Jimmyshiau (talk | contribs) |
|||
(11 intermediate revisions by 3 users not shown) | |||
Line 4: | Line 4: | ||
*Demonstration: [http://www.zkoss.org/zkdemo/reporting/google_map Gmaps] | *Demonstration: [http://www.zkoss.org/zkdemo/reporting/google_map Gmaps] | ||
− | *Java API: | + | *Java API: [https://github.com/zkoss/zkgmapsz/releases in release zip] |
*JavaScript API: N/A | *JavaScript API: N/A | ||
*Style Guide: N/A | *Style Guide: N/A | ||
Line 17: | Line 17: | ||
<source lang="xml" > | <source lang="xml" > | ||
− | |||
<script type="text/javascript" content="zk.googleAPIkey='Your-Google-API-Key'"/> | <script type="text/javascript" content="zk.googleAPIkey='Your-Google-API-Key'"/> | ||
<gmaps id="mymap" width="500px" height="300px" showSmallCtrl="true"> | <gmaps id="mymap" width="500px" height="300px" showSmallCtrl="true"> | ||
− | <gpolyline | + | <gpolyline path="37.42838786,-122.13998795, |
− | + | 37.43561240,-122.13277816, | |
+ | 37.42416187,-122.11441040, | ||
+ | 37.42157162,-122.12007522, | ||
+ | 37.41734524,-122.12316513, | ||
+ | 37.42838786,-122.13998795"/> | ||
</gmaps> | </gmaps> | ||
− | |||
</source> | </source> | ||
+ | |||
+ | == Disable Path Encoding == | ||
+ | |||
+ | {{versionSince| 3.3.0}} | ||
+ | |||
+ | In order to preserve bandwidth the polyline/polygon path coordinates are encoded (default) with a [https://developers.google.cn/maps/documentation/utilities/polylinealgorithm lossy algorithm] (i.e. some precision is lost - visible at high zoom levels). In cases where the highest precision is needed (e.g. when editing a polyline/polygon) this encoding can be disabled by setting <code>pathEncoded="false"</code> / <code>polygon.setPathEncoded(false);</code> - at the cost of increased network request and response sizes. | ||
=Supported Events= | =Supported Events= | ||
− | {| | + | {| class='wikitable' | width="100%" |
! <center>Name</center> | ! <center>Name</center> | ||
! <center>Event Type</center> | ! <center>Event Type</center> | ||
Line 43: | Line 51: | ||
*None | *None | ||
− | =Use | + | =Use Cases= |
− | {| | + | {| class='wikitable' | width="100%" |
! Version !! Description !! Example Location | ! Version !! Description !! Example Location | ||
|- | |- | ||
Line 56: | Line 64: | ||
{{LastUpdated}} | {{LastUpdated}} | ||
− | {| | + | {| class='wikitable' | width="100%" |
! Version !! Date !! Content | ! Version !! Date !! Content | ||
|- | |- |
Latest revision as of 09:30, 15 September 2023
Gpolyline
- Demonstration: Gmaps
- Java API: in release zip
- JavaScript API: N/A
- Style Guide: N/A
Employment/Purpose
Polyline drawn on the Google Maps per the given (latitude, longitude) points and visible zoom level(0~3).
Example
<script type="text/javascript" content="zk.googleAPIkey='Your-Google-API-Key'"/>
<gmaps id="mymap" width="500px" height="300px" showSmallCtrl="true">
<gpolyline path="37.42838786,-122.13998795,
37.43561240,-122.13277816,
37.42416187,-122.11441040,
37.42157162,-122.12007522,
37.41734524,-122.12316513,
37.42838786,-122.13998795"/>
</gmaps>
Disable Path Encoding
Since 3.3.0
In order to preserve bandwidth the polyline/polygon path coordinates are encoded (default) with a lossy algorithm (i.e. some precision is lost - visible at high zoom levels). In cases where the highest precision is needed (e.g. when editing a polyline/polygon) this encoding can be disabled by setting pathEncoded="false"
/ polygon.setPathEncoded(false);
- at the cost of increased network request and response sizes.
Supported Events
None | None |
- Inherited Supported Events: XulElement
Supported Children
*None
Use Cases
Version | Description | Example Location |
---|---|---|
Version History
Version | Date | Content |
---|---|---|