android-mapview

MapView Balloons to a DetailView

ぃ、小莉子 提交于 2019-12-13 01:00:03
问题 In my MapView there are shown Balloons like this:http://www.codemobiles.com/forum/code-mobile-topic-4180.html (it´s more or less the same code) What I want: If I press Balloon 1 it should open the Detail View with the Information of 1 and when I press the Ballon 2 it should open the Detail View with the informations of 2 I added this to the Itemized Overlay: c.startActivity(new Intent(c.getApplicationContext(), QuoteDetail.class)); So when I press Balloon 1 its open the DetailView with

Simplest way to draw a route on mapview

一世执手 提交于 2019-12-12 23:26:39
问题 I want to show a route between the user's current location and the location he entered in the searchview. Here is my code for the onQueryTextSubmit method @Override public boolean onQueryTextSubmit(String query) { // TODO Auto-generated method stub try { if(direction.isChecked() == false) { gc = new Geocoder(this); addresses = gc.getFromLocationName(query,5); String add = ""; if (addresses.size() > 0) { p = new GeoPoint( (int) (addresses.get(0).getLatitude() * 1E6), (int) (addresses.get(0)

Why does MapView show grey tiles and not the map?

匆匆过客 提交于 2019-12-12 19:14:34
问题 Ok, so I got my SHA1 fingerprint by creating a batch file. After that, I went to the "Services" page and enabled Google Maps API v2 and v3. I also went to the "API Access" page and created a new Android Key with the SHA1;PACKAGENAME. After this, I went to my project folder and added the following code: <permission android:name = "com.example.test.permission.MAPS_RECEIVE" android:protectionLevel = "signature" /> <uses-feature android:glEsVersion = "0x00020000" android:required = "true" />

Eclipse not Recognizing any imports

被刻印的时光 ゝ 提交于 2019-12-12 10:53:23
问题 I seem to have botched up something in Eclipse. It isn't recognizing any of the libraries that I am trying to import. Here are some of the things not being recognized: import java.util.ArrayList; import android.content.Intent; import com.google.android.maps.MapView; This is a open source project that I downloaded and then imported into Eclipse. I think I also downloaded the google apis the wrong way because things like MapView don't work in my other projects as well. Can someone please help

Remove all Overlays

烂漫一生 提交于 2019-12-12 07:37:50
问题 I have the following code to add an Overlay myMapView.getOverlays().add(sites); myMapView.invalidate(); I also have the following remove code where sites is a global variable. if (sites != null) { // myMapView.getOverlays().clear(); myMapView.getOverlays().remove(sites); myMapView.invalidate(); sites = null; } Sometimes I am left with duplicates so would like a way to remove all overlays from a map, is this possible? 回答1: Looks like I did have the answer all along! myMapView.getOverlays()

Layout to constrain size of MapView

流过昼夜 提交于 2019-12-12 06:36:12
问题 I'm trying to constrain the size of a MapView so that it takes up, say 90% of the screen's height and leaves the remaining 10% at the bottom for another view e.g. a menu bar. I can get the effect but the menu bar overlays the MapView so that the bottom part of the map is not visible. Although the MapView can scroll the Google logo is partly obscured (and I suspect this might be against the T & C's of the Maps API), I'd rather constrain the MapView to be contained within a designated part of

Display a limited number of sorted annotations in Mapview

孤街浪徒 提交于 2019-12-12 06:12:41
问题 I have an NSArray of 500 annotations and I basically want to show only the ten nearest annotations to the user (the rest would not be added on Mapview) How should I do that? Here is my code: -(void) loadAndSortPOIs { [poiArray release]; nextPoiIndex = 0; NSString *poiPath = [[NSBundle mainBundle] pathForResource:@"annotations" ofType:@"plist"]; poiArray = [[NSMutableArray alloc] initWithContentsOfFile:poiPath]; CLLocation *homeLocation = [[CLLocation alloc] initWithLatitude:homeCoordinate

MapView - Disable dragging around, but allow zooming

白昼怎懂夜的黑 提交于 2019-12-12 05:32:17
问题 I have a ViewPager with 3 fragments inside, on the outer right I want to display a MapView - working fine so far. But I'd like to disable dragging it around, but still let the user zoom in / out - with a fixed center. If the user would be allowed to drag the map around, it messes with the viewpager scrolling abilities. Tried to disable clickable + focusable but - of course - no zooming anymore.. Looked at other questions here at stackoverflow but none provided a working solution so far..

How to move map under a marker? android

非 Y 不嫁゛ 提交于 2019-12-12 05:25:02
问题 I want to implement the drag effect of a map. When we drag the map the marker should show the current position or latitude and longitude. Its done in Uber application see below: In this marker shows the current location as the map is dragged. How can I achieve this??? ChooseFromMapActivity public class ChooseFromMapActivity extends AppCompatActivity implements GoogleMap.OnCameraChangeListener { TextView textShowAddress; private GoogleMap mMap; LatLng latLng; double latitude = 17.385044;

How do i implement falling pins animation for markers in android map view

﹥>﹥吖頭↗ 提交于 2019-12-12 04:46:43
问题 Is there any way to implement falling pins/markers animation for google maps in android like that in iPhone ??? 回答1: Android has overlay markers (see ItemizedOverlay) that make it easy to add images to maps, BUT note that, in my experience at least, animated images do not work when added to overlays. I found it necessary to add a View on top of the MapView, and add imagery to that, and I've successfully added animated drawable images to the map using that approach. For more details see here: