Skip to content
Permalink
Browse files

Added nation to model and overlay.

  • Loading branch information...
Kigsz committed Apr 7, 2011
1 parent 3cfa9ff commit 4de87e8a9b8c20707d56ded4e637ca3f46994bd6
@@ -73,6 +73,7 @@ private static void initLUSitesList(Context context) {
loadAuditoriums(context);
loadBikePumps(context);
loadLibraries(context);
loadNations(context);
}
private static void loadAuditoriums(Context context) {
LUSitesList luSites = getLUSites(context, eu.chuvash.android.lusites.R.raw.lusites_utf8);
@@ -90,9 +91,16 @@ private static void loadBikePumps(Context context) {
}
private static void loadLibraries(Context context) {
LUSitesList luSites = getLUSites(context, eu.chuvash.android.lusites.R.raw.libraries_utf8);
for (LUSite ls: luSites) {
for (LUSite ls : luSites) {
Library l = new Library(ls.getLongitude(), ls.getLatitude(), ls.getName(), ls.getSnippet());
luSitesList.add(l);
}
}
private static void loadNations(Context context) {
LUSitesList luSites = getLUSites(context, eu.chuvash.android.lusites.R.raw.nations_utf8);
for (LUSite ls : luSites) {
Nation n = new Nation(ls.getLongitude(), ls.getLatitude(), ls.getName(), ls.getSnippet());
luSitesList.add(n);
}
}
}
@@ -0,0 +1,8 @@
package eu.chuvash.android.lusites.model;

public class Nation extends LUSite {
public Nation(double longitude, double latitude, String name, String snippet) {
super(longitude, latitude, name, snippet);
}

}
@@ -0,0 +1,41 @@
package eu.chuvash.android.lusites.overlays;

import com.google.android.maps.GeoPoint;

import eu.chuvash.android.lusites.model.LUSite;
import eu.chuvash.android.lusites.model.LUSitesList;
import eu.chuvash.android.lusites.model.Library;
import eu.chuvash.android.lusites.model.Nation;
import android.content.Context;
import android.graphics.drawable.Drawable;

public class NationOverlay extends LUSiteOverlay {

public NationOverlay(Context context) {
super(context);
}
@Override
public void initLUSites() {
LUSitesList luSites = LUSitesList.getLUSitesList(context);
if (luSites.size() > 0) {
Drawable defaultMarker = getMarker(eu.chuvash.android.lusites.R.drawable.nation_pin);
Drawable highlightedMarker = getMarker(eu.chuvash.android.lusites.R.drawable.nation_red_pin);
for (LUSite ls : luSites) {
if (ls instanceof Nation) {
GeoPoint gp = getPoint(ls.getLongitude(), ls.getLatitude());
LUSiteOverlayItem item = new LUSiteOverlayItem(gp,
ls.getName(), ls.getSnippet(), defaultMarker,
highlightedMarker);
overlayItems.add(item);
}
}
populate();
}
}

@Override
public String getSettingsEntry() {
return context.getString(eu.chuvash.android.lusites.R.string.settings_overlays_item_nations);
}

}
@@ -37,6 +37,7 @@ private void initAllLusitesOverlays() {
allLusitesOverlays.add(new AuditoriumOverlay(activity));
allLusitesOverlays.add(new BikePumpOverlay(activity));
allLusitesOverlays.add(new LibraryOverlay(activity));
allLusitesOverlays.add(new NationOverlay(activity));
}
public void bringLusitesOverlaysOnMap() {
//TODO See if these two init methods invokes have to be invoked many times

0 comments on commit 4de87e8

Please sign in to comment.
You can’t perform that action at this time.