android-mapview

How to add google-play-services.jar project dependency so my project will run and present map

我的梦境 提交于 2019-11-27 18:23:57
I have following problem: I try to use SupportMapFragment from com.google.android.gms.maps.SupportMapFragment which is part of Google Maps Android API v2. My first approach was to add project to Eclipse from android-sdk\extras\google\google_play_services\libproject\google-play-services_lib location and set it as referenced project in Properties -> Project References menu of MyApp. I also added project to Java Build Path / Projects . Error indicators disappeared from Eclipse but when I tried to run my app I got NoClassDefFoundError exception. So my second approach was to copy jar file from

Should I use MapView or MapFragment

痞子三分冷 提交于 2019-11-27 18:19:38
I am not sure whether I should be using MapView or stick to using a MapFragment . My application is an app that finds the nearest set of places that are closest to you. I want to be able to add locations, display details of a marker when I press a marker and when the user moves along the map I want to be able to get the coordinates of the center of the map and display the nearest locations within a defined radius. Would I be at a disadvantage if I continue to use MapFragments or should I switch over to MapView while I still have the chance? Emil Adz First of all, soon the MapView and Google

MapView inside Fragment - specified child already has a parent

故事扮演 提交于 2019-11-27 18:13:22
问题 I'm trying to show a MapView inside a fragment (using the hacked compatibility library). The following has worked just fine in the past: fragment's onCreateView() simply returns a new FrameLayout fragment's onActivityCreated() gets the MapView from the Acitivity and adds it to its view hierarchy onDestroyView() removes the MapView from its view hierarchy Now I would like the fragment to use a layout defined in xml so that I can have some other UI stuff. Putting the MapView element in the

Combine image and text to drawable

荒凉一梦 提交于 2019-11-27 17:44:37
I want to create a drawable, which consists of a map pin(bubble) and some text. The bubble should be in the background and the text in the foreground. This drawable should be passed in super(drawable) of the class BalloonItemizedOverlay which extends ItemizedOverlay<Item> . In other words, I want to show text in the bubble that appears in the map. I am using the Hello Mapview tutorial Marmoy This method takes a drawable from your resources, draws some text on top of it and returns the new drawable. All you need to do is give it the resource id of your bubble, and the text you want on top. Then

Google Maps Android API v2 very slow when adding lots of Markers

喜你入骨 提交于 2019-11-27 17:27:31
I am updating an existing Android app to use the new Google Maps Android API v2. I have about 2500 markers that I want to add to the map. With the older version of the API I found the responsiveness of the maps to be horrendous when there are 2500 markers, so I had to work around it by only adding markers that are in the current visible region of the map. I was hoping 2500 markers would be faster with the new API, but it's still awful, even on a Nexus 4, and I'm not seeing any sort of option to do clustering. So my question: how can I determine if a certain lat/lng point is contained within

Android: ItemizedOverlay onTouchEvent and onTap overlapping

情到浓时终转凉″ 提交于 2019-11-27 15:24:14
问题 I am trying to place a marker on a map overlay and then present a dialog when the user selects the drawable. The problem is the events seem to overlap. After I click the map and the marker is drawn, the onTap fires immediately afterwards, and because I have just drawn the marker, it is directly under the onTap event, so my dialog always fires. Does anyone have any suggestions on how to make these events mutually exclusive? Here is the code for the map activity: public class SelectGameLocation

android MapView always causes an OutOfMemoryError in nested elements

时光怂恿深爱的人放手 提交于 2019-11-27 14:28:51
I am trying to create a MapView (currently without any overlays) inside some nested elements. It is basically something like ScrollView -> RelativeLayout -> RelativeLayout -> MapView <com.google.android.maps.MapView android:id="@+id/mapview" android:layout_width="420px" android:layout_height="300px" android:clickable="false" android:apiKey="key"/> Seems fine for me. There is nothing more that I do with it on startup but it always causes the following: 04-04 13:38:33.910: WARN/dalvikvm(13628): threadid=1: thread exiting with uncaught exception (group=0x40015560) 04-04 13:38:33.996: ERROR

Android MapView overlaps DrawerLayout

只谈情不闲聊 提交于 2019-11-27 13:58:05
问题 I have simple layout structure: DrawerLayout \-- FrameLayout // @+id/fragment_container \-- ListView // @+id/drawer_list By clicking of any drawer item I'm inserting/replacing fragment via FragmentTransaction.replace() into R.id.fragment_container with corresponding Fragment instance. One of those Fragments contains MapView . And it has rendering problems on different devices, but at the same time DDMS shows me right screenshot. EDITED Issue appears on such devices: Huawei U9508 , Android 4.0

How can I use a custom bitmap for the “you are here” point in a MyLocationOverlay?

大城市里の小女人 提交于 2019-11-27 13:50:18
I've poured over the docs and haven't been able to figure this out. Is it even possible? Please see this It looks like the correct mechanism to do this is to extend MyLocationOverlay then override the drawMyLocation() protected method. The following uses an arrow to show where "you" are and which way "you" are pointing: package com.example; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Matrix; import android.graphics.Point; import android.location.Location; import com.google.android

Android - MapView contained within a Listview

情到浓时终转凉″ 提交于 2019-11-27 13:44:34
Currently I am trying to place a MapView within a ListView. Has anyone had any success with this? Is it even possible? Here is my code: ListView myList = (ListView) findViewById(android.R.id.list); List<Map<String, Object>> groupData = new ArrayList<Map<String, Object>>(); Map<String, Object> curGroupMap = new HashMap<String, Object>(); groupData.add(curGroupMap); curGroupMap.put("ICON", R.drawable.back_icon); curGroupMap.put("NAME","Go Back"); curGroupMap.put("VALUE","By clicking here"); Iterator it = data.entrySet().iterator(); while (it.hasNext()) { //Get the key name and value for it Map