Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…viewballoons into westonplatter-master
  • Loading branch information
jgilfelt committed Apr 8, 2012
2 parents 574b85f + dc78ffa commit c17aec3
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 18 deletions.
4 changes: 2 additions & 2 deletions android-mapviewballoons-example/AndroidManifest.xml
Expand Up @@ -18,7 +18,7 @@
</activity>
<activity
android:label="@string/app_name"
android:name=".MyMap"/>
android:name=".simple.SimpleMap"/>
<activity
android:label="@string/app_name"
android:name=".custom.CustomMap"/>
Expand All @@ -32,7 +32,7 @@
<uses-sdk
android:minSdkVersion="4"
android:targetSdkVersion="8" />

<uses-permission android:name="android.permission.INTERNET" >
</uses-permission>

Expand Down
19 changes: 17 additions & 2 deletions android-mapviewballoons-example/src/mapviewballoons/Main.java
@@ -1,6 +1,21 @@
/***
* Copyright (c) 2011 readyState Software Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

package mapviewballoons;

import mapviewballoons.example.MyMap;
import mapviewballoons.example.simple.SimpleMap;
import mapviewballoons.example.custom.CustomMap;
import mapviewballoons.example.tapcontrolled.TapControlledMap;
import android.app.ListActivity;
Expand Down Expand Up @@ -29,7 +44,7 @@ public void onItemClick(AdapterView<?> parent, View view, int position, long id)
Intent intent = null;
switch (position) {
case 0:
intent = new Intent(this, MyMap.class);
intent = new Intent(this, SimpleMap.class);
startActivity(intent);
break;
case 1:
Expand Down
Expand Up @@ -13,7 +13,7 @@
*
*/

package mapviewballoons.example;
package mapviewballoons.example.simple;

import java.util.ArrayList;

Expand All @@ -26,12 +26,12 @@

import com.readystatesoftware.mapviewballoons.BalloonItemizedOverlay;

public class MyItemizedOverlay extends BalloonItemizedOverlay<OverlayItem> {
public class SimpleItemizedOverlay extends BalloonItemizedOverlay<OverlayItem> {

private ArrayList<OverlayItem> m_overlays = new ArrayList<OverlayItem>();
private Context c;

public MyItemizedOverlay(Drawable defaultMarker, MapView mapView) {
public SimpleItemizedOverlay(Drawable defaultMarker, MapView mapView) {
super(boundCenter(defaultMarker), mapView);
c = mapView.getContext();
}
Expand Down
Expand Up @@ -13,10 +13,12 @@
*
*/

package mapviewballoons.example;
package mapviewballoons.example.simple;

import java.util.List;

import mapviewballoons.example.R;

import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.Menu;
Expand All @@ -29,14 +31,14 @@
import com.google.android.maps.Overlay;
import com.google.android.maps.OverlayItem;

public class MyMap extends MapActivity {
public class SimpleMap extends MapActivity {

MapView mapView;
List<Overlay> mapOverlays;
Drawable drawable;
Drawable drawable2;
MyItemizedOverlay itemizedOverlay;
MyItemizedOverlay itemizedOverlay2;
SimpleItemizedOverlay itemizedOverlay;
SimpleItemizedOverlay itemizedOverlay2;

@Override
public void onCreate(Bundle savedInstanceState) {
Expand All @@ -51,7 +53,7 @@ public void onCreate(Bundle savedInstanceState) {

// first overlay
drawable = getResources().getDrawable(R.drawable.marker);
itemizedOverlay = new MyItemizedOverlay(drawable, mapView);
itemizedOverlay = new SimpleItemizedOverlay(drawable, mapView);

GeoPoint point = new GeoPoint((int)(51.5174723*1E6),(int)(-0.0899537*1E6));
OverlayItem overlayItem = new OverlayItem(point, "Tomorrow Never Dies (1997)",
Expand All @@ -67,7 +69,7 @@ public void onCreate(Bundle savedInstanceState) {

// second overlay
drawable2 = getResources().getDrawable(R.drawable.marker2);
itemizedOverlay2 = new MyItemizedOverlay(drawable2, mapView);
itemizedOverlay2 = new SimpleItemizedOverlay(drawable2, mapView);

GeoPoint point3 = new GeoPoint((int)(51.513329*1E6),(int)(-0.08896*1E6));
OverlayItem overlayItem3 = new OverlayItem(point3, "Sliding Doors (1998)", null);
Expand Down
Expand Up @@ -17,7 +17,7 @@

import java.util.List;

import mapviewballoons.example.MyItemizedOverlay;
import mapviewballoons.example.simple.SimpleItemizedOverlay;
import mapviewballoons.example.R;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
Expand All @@ -37,8 +37,8 @@ public class TapControlledMap extends MapActivity {
List<Overlay> mapOverlays;
Drawable drawable;
Drawable drawable2;
MyItemizedOverlay itemizedOverlay;
MyItemizedOverlay itemizedOverlay2;
SimpleItemizedOverlay itemizedOverlay;
SimpleItemizedOverlay itemizedOverlay2;

@Override
public void onCreate(Bundle savedInstanceState) {
Expand All @@ -62,7 +62,7 @@ public boolean onSingleTap(MotionEvent e) {

// first overlay
drawable = getResources().getDrawable(R.drawable.marker);
itemizedOverlay = new MyItemizedOverlay(drawable, mapView);
itemizedOverlay = new SimpleItemizedOverlay(drawable, mapView);
// set iOS behavior attributes for overlay
itemizedOverlay.setShowClose(false);
itemizedOverlay.setShowDisclosure(true);
Expand All @@ -82,7 +82,7 @@ public boolean onSingleTap(MotionEvent e) {

// second overlay
drawable2 = getResources().getDrawable(R.drawable.marker2);
itemizedOverlay2 = new MyItemizedOverlay(drawable2, mapView);
itemizedOverlay2 = new SimpleItemizedOverlay(drawable2, mapView);
// set iOS behavior attributes for overlay
itemizedOverlay2.setShowClose(false);
itemizedOverlay2.setShowDisclosure(true);
Expand Down

0 comments on commit c17aec3

Please sign in to comment.