android-mapview

want to draw a line between any two location in android

无人久伴 提交于 2019-12-25 05:22:31
问题 This is my main activity import java.net.HttpURLConnection; import java.net.URL; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import android.os.Bundle; import android.util.Log; import com.google.android.maps.GeoPoint; import com.google.android.maps.MapActivity; import com.google.android.maps.MapController; import com.google.android.maps.MapView; public class

MapFragment blocked or stunned when application is killed or state saved

三世轮回 提交于 2019-12-25 04:57:25
问题 I'm getting problems using MapFragment + ListFragment in an Activity, when I use show() and hide() method, everything works ok, but when I have my application in background and I return, I get the GoogleMap stunned or blocked, and I don't know what to do to solve that. The only solution I got to work fine, is using replace transactions, but I don't like this way, because in every transaction we should initiate all map place balloons, and it doesn't keep your last camera location, so... I don

MapView works incorrect

笑着哭i 提交于 2019-12-25 04:22:20
问题 I have 2 Activities. In main Activity I start new Activity with MapView Intent set = new Intent(); set.setClass(getApplicationContext(), OrderMap.class); startActivity(set); onCreate in MapView @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.map); mapView = (MapView) findViewById(R.id.mymapview); mapView.setBuiltInZoomControls(true); } But there is no Zoom Controls and it looks like View "freeze". I can't move map. What's

Is there a method to check whether the current Map is in Map or Satellite mode?

試著忘記壹切 提交于 2019-12-24 21:43:37
问题 I am setting the Map to Satellite view on click of a toggle button mapToggle.setOnClickListener(new OnClickListener() { public void onClick(View v) { if (mapToggle.isChecked()) { mapV.setSatellite(true); } else { mapV.setSatellite(false); } }}); I want to programitically determine which mode it is in when the app restarts. Please advice. 回答1: The way I accomplished this is to set an int value in your SharedPreferences. Then onClick of that button, get the value and switch satellite on or off

moving map in mapview from one location to another in android

别等时光非礼了梦想. 提交于 2019-12-24 20:17:00
问题 i have a situation in my app where i should move my map from one location to another location....i am quite new to android..and i found out how to draw a line in between two locations.. public class Mapview extends MapActivity implements LocationListener{ MapController mc; GeoPoint p,p1,p2; LocationManager lm; String provider; class Mapoverlay extends com.google.android.maps.Overlay { @Override public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) { // TODO Auto

Android Maps within TabHost. getTabHost() return error

空扰寡人 提交于 2019-12-24 19:34:12
问题 I have problem with initializing TabHost. I need to have in View several Tabs which show different activities: one must show google map, second - log in form. In created code there is error "The method getTabHost() is undefined for the type MapViewDemo" package com.example.android.apis.view; import java.util.List; import android.app.*; import com.example.android.google.apis.R; import com.google.android.maps.GeoPoint; import com.google.android.maps.MapActivity; import com.google.android.maps

Action after mapview (swipe) animation stops

好久不见. 提交于 2019-12-24 17:07:05
问题 The problem I'm using a mapview with an overlay. When I swipe, the overlay has to be redrawn. But it just chooses some random point during the animation. The question How can I make sure that I perform an action (in general) only after the mapview stopped moving? 来源: https://stackoverflow.com/questions/12194643/action-after-mapview-swipe-animation-stops

how to add compass to mapview

强颜欢笑 提交于 2019-12-24 15:34:54
问题 How do I get the compass to be shown on the screen when my mapview is created. What is wrong with this code? any suggestions? protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.map); mapView = (MapView) findViewById(R.id.mapview); mapView.setBuiltInZoomControls(true); mc = mapView.getController(); myLoc = new MyLocationOverlay(this, mapView); myLoc.enableCompass(); mapView.getOverlays().add(myLoc); mapView.postInvalidate();

Two finger rotation for OSMdroid mapview

半城伤御伤魂 提交于 2019-12-24 13:44:08
问题 I'm trying to make two finger rotation for my offline maps using osmdroid. I'm new to using maps for android. I have a geoTIFF, I'm planning to extract info using NDK and later send it to JAVA. I need to use the geoPoint to align with True North Up using compass as well. How can I proceed, any help? I did try this: Android Two finger rotation example, but no luck, my app was not able to detect any two finger event. @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate

Android Mapview: Control ordering of multiple types of OverlayItems?

五迷三道 提交于 2019-12-24 08:56:26
问题 I have searched for a while on this problem but have come up trumps. I have a simple mapview that makes use of custom overlay items on a ManagedOverlay, let's call them redOverlayItem and blueOverlayItem . All the ManagedOverlay does is query my database for a set of locations of varying types and then place them on a map asynchronously. My managed overlay works fine, however I can't seem to be able to control the "z" ordering. For instance, sometimes I have redOverlayItem 's covering