ThisbuoyData buoyData ndude extra Buoy Data property

We extend Overlayltem to bring in all the necessary properties of an item to be drawn on the map: a location, a title, a snippet, and so on ©. In the constructor we make the call to the superclass with the required properties ©, and we assign additional elements our subclass supports. In this case we are adding a BuoyData member (itself a bean with name, water temperature, wave height, and so on-type properties) ©.

After we have the individual item class prepared, we need a class that extends ItemizedOverlay and uses a Collection of the items to display them on the map one-by-one. Listing 11.9, the BuoyItemizedOverlay class, shows how this works.

0 0

Post a comment