Bug 1804 - ItemizedOverlay does not have the abstract createItem method to override.
Summary: ItemizedOverlay does not have the abstract createItem method to override.
Status: RESOLVED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 1.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
: 1806 ()
Depends on:
Blocks:
 
Reported: 2011-11-01 05:47 UTC by Tomasz Cielecki
Modified: 2013-03-07 14:45 UTC (History)
5 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Tomasz Cielecki 2011-11-01 05:47:43 UTC
I found a bug in the ItemizedOverlay in Android.GoogleMaps, which does not make it possible to implement your own ItemizedOverlay.

The abstract method createItem(int index) is not overridable, which it is in Java, and which needs to be overriden in order to implement your own overlay.

The error thrown when trying to build:
"C:\Users\tcielecki\Desktop\MonoDroid.GoogleMapsDemo\MonoDroid.GoogleMapsDemo\MonoDroid.GoogleMapsDemo.csproj" (SignAndroidPackage target) (1) ->
(_CompileJava target) -> 
  obj\Debug\android\src\monodroid\googlemapsdemo\MyItemizedOverlay.java(4,8): error :  monodroid.googlemapsdemo.MyItemizedOverlay is not abstract and does not override abstract method createItem(int) in com.google.android.maps.ItemizedOverlay [C:\Users\tcielecki\Desktop\MonoDroid.GoogleMapsDemo\MonoDroid.GoogleMapsDemo\MonoDroid.GoogleMapsDemo.csproj]
obj\Debug\android\src\monodroid\googlemapsdemo\MyItemizedOverlay.java(4,8): error : public class MyItemizedOverlay [C:\Users\tcielecki\Desktop\MonoDroid.GoogleMapsDemo\MonoDroid.GoogleMapsDemo\MonoDroid.GoogleMapsDemo.csproj]
obj\Debug\android\src\monodroid\googlemapsdemo\MyItemizedOverlay.java(4,8): error :  [C:\Users\tcielecki\Desktop\MonoDroid.GoogleMapsDemo\MonoDroid.GoogleMapsDemo\MonoDroid.GoogleMapsDemo.csproj]

Github repo with example: https://github.com/Cheesebaron/MonoDroid.GoogleMapsDemo
Comment 1 Jonathan Pryor 2011-11-01 16:15:33 UTC
Android.GoogleMaps.ItemizedOverlay can't be subclassed, because it doesn't declare the abstract ItemizedOverlay.CreateItem(int) method:

http://code.google.com/android/add-ons/google-apis/reference/com/google/android/maps/ItemizedOverlay.html

The reason for this is that ItemizedOverlay is a generic type, and ItemizedOverlay.createItem() returns the generic type parameter, which `generator` doesn't like. :-/
Comment 2 Jonathan Pryor 2011-11-01 16:15:46 UTC
*** Bug 1806 has been marked as a duplicate of this bug. ***
Comment 3 Atsushi Eno 2011-11-07 20:08:34 UTC
I made a fix in maps API for "generator" limitation workaround. The next release will contain CreateItem() method that returns Java.Lang.Object. Thanks for the report!