KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > lamatek > tags > google > GoogleMapBlowupTag


1 package com.lamatek.tags.google;
2
3 import javax.servlet.jsp.tagext.Tag JavaDoc;
4 import javax.servlet.jsp.tagext.TagSupport JavaDoc;
5
6
7 public class GoogleMapBlowupTag extends TagSupport JavaDoc {
8     
9     boolean display = false;
10     String JavaDoc maptype = "map";
11     int zoom = 1;
12     /**
13      * Overrides doStartTag() from TagSupport. Developers should not override this method.
14      */

15     public int doStartTag() {
16         return SKIP_BODY;
17     }
18     /**
19      * Overrides doEndTag() from TagSupport. Developers should not override this method.
20      */

21     public int doEndTag() {
22         Tag JavaDoc tag = this;
23         while (tag.getParent() != null) {
24             if (tag.getParent() instanceof GoogleMapMarkerTag) {
25                 ((GoogleMapMarkerTag) tag.getParent()).setBlowup(this);
26                 return EVAL_PAGE;
27             }
28             tag = tag.getParent();
29         }
30         return EVAL_PAGE;
31     }
32     /**
33      * Returns the specified map type for this blowup map. Valid values are map, hybrid, satellite
34      * or null.
35      *
36      * @return A string that references the desired blowup map type or null (which defaults to the current view).
37      */

38     public String JavaDoc getMaptype() {
39         return maptype;
40     }
41     /**
42      * Sets the specified map type for this blowup map. Valid values are map, hybrid, satellite
43      * or null.
44      *
45      * @param maptype A string that references the desired blowup map type or null (which defaults to the current view).
46      */

47     public void setMaptype(String JavaDoc maptype) {
48         this.maptype = maptype;
49     }
50     /**
51      * Returns the desired zoom level for this blowup map.
52      *
53      * @return An int that denotes desired zoom level. Default is 1.
54      */

55     public int getZoom() {
56         return zoom;
57     }
58     /**
59      * Sets the desired zoom level for this blowup map.
60      *
61      * @param zoom The desired zoom level.
62      */

63     public void setZoom(int zoom) {
64         this.zoom = zoom;
65     }
66     /**
67      * Sets whether or not this blowup map should be initially displayed. If set to
68      * true then the map will be displayed. If set to false, the map will
69      * only display after the user has clicked on the parent marker.
70      *
71      * @param display True to display, false to require a click to display.
72      */

73     public void setDisplay(boolean display) {
74         this.display = display;
75     }
76     /**
77      * Returns true if this map is set to initially display. Returns false otherwise.
78      *
79      * @return true or false.
80      */

81     public boolean isDisplay() {
82         return display;
83     }
84 }
85
Popular Tags