android-mapview

OnClickListener for pushpin

风格不统一 提交于 2019-12-02 12:13:46
Here I have used google map and an overlay. I have used an image of pushpin to point to the GeoPoint. I want to set an OnClickListener event for the push pin. When user touches the pin, I want to toast a message. Below is the code. import java.util.List; import com.google.android.maps.GeoPoint; import com.google.android.maps.MapActivity; import com.google.android.maps.MapController; import com.google.android.maps.MapView; import com.google.android.maps.Overlay; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Point;

Dynamically draw lines between multiple GeoPoints in Android MapView

霸气de小男生 提交于 2019-12-02 12:07:26
I am developing an application that has a few custom overlays on a MapView - representing vessels. When selecting a vessel, I am showing its previous positions on the map, again with custom overlay items, and I would like to connect them with a line. Some relevant problems I saw here were solved by overriding the Draw method, and by hard-coding the GeoPoints' coordinates in the Draw method. That does not help me at all, since I have many points from different vessels, and cannot hard-code them all into Draw. Is there a simple way to just draw a line between the GeoPoints inside the for loop

This app won't run unless you update Google Play Services (via Bazaar)

安稳与你 提交于 2019-12-02 09:59:01
I'm testing out the new Google Maps API V2 for Android, and I'm getting this message when the app launches: This is running on an 4.1 emulator. Here is my AndroidManifest.xml file: <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.maptest" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" /> <permission android:name="com.example.maptest.permission.MAPS_RECEIVE" android:protectionLevel="signature"/> <uses-permission android:name="com.example.maptest.permission.MAPS_RECEIVE"/> <uses

Create a map with colored polygons and coordinate points by using a .shp file in combination with another dataframe with coordinates

妖精的绣舞 提交于 2019-12-02 08:30:04
I have the following map boundaries in this .gdb folder and here I have a csv which contains the variables that I want to plot and the coordinates of the points that need to be displayed on the map. My final goal is to create a map with polygons and inside every polygon there should be points according to the coordinates. Every polygon should be colored according to the count of studentid (students) for the year 2019. Any alternative is accepted I believe that the 1st code chunk below is correct: library(sf) library(tidyverse) library(data.table) library(tigris) library(leaflet) library

Blackberry MapView plot coords

☆樱花仙子☆ 提交于 2019-12-02 07:48:47
I was wondering if it is possible to plot locations/coords on the MapView class of blackberry. http://www.blackberry.com/developers/docs/5.0.0api/net/rim/blackberry/api/maps/MapView.html In iOS I made an app the drops pins(annotations) on the MKMapView but I can't find something simular for blackberry? Any guidance will be appreciated You have basically two options: 1) If you want the map to be embedded within your own application, use the MapField to add a map to your screen and then override the paint() method to manually draw your pins on the screen. 2) If you just want to launch the maps

How to capture location from MapActivity

那年仲夏 提交于 2019-12-02 06:59:07
Given ... An Activity that extends from MapActivity Uses ItemizedOverlay to show some balloons on the map ZoomControls are enabled The ItemizeOverlay implements onTap(...) which works perfectly ok when tapping one of the overlay items. The question is: How to identify a tap on another part of the map (with the intention of getting the location and center'ing on that point) You should be able to create an 'invisible' overlay (in the sense that you don't draw anything in onDraw ) that sits at the front of the MapView's overlay list and in onTap , sets the map center with MapController.setCenter

How to plot a pre-build map from google maps on a MapView

大憨熊 提交于 2019-12-02 06:54:37
问题 I'm trying to read a map from a link (http://maps.google.com/maps/ms?msid=216892338463540803496.000494dd57eb5ebce6db2&msa=0) and plot it on a MapView, is it possible? 回答1: As you posted more information in my previous answer (" but I don't want to parse the KML and plot point by point. I was wondering if theres a way to plot all at once "), I can now redifine my answer. You should try these lines and adapt it to your needs: Intent mapIntent = new Intent(Intent.ACTION_VIEW); Uri uri1 = Uri

Android Map is plain white screen - no errors

拈花ヽ惹草 提交于 2019-12-02 06:25:52
XML (activity_maptest.xml): <?xml version="1.0" encoding="utf-8"?> <fragment xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" android:name="com.google.android.gms.maps.MapFragment"/> Java (Maptest.java): package com.example.app; import android.app.Activity; import android.os.Bundle; public class Maptest extends Activity { public class MapActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout

Random MapView Force Close : NullPointerException com.google.googlenav.map.Tile.getTile

落爺英雄遲暮 提交于 2019-12-02 05:50:56
I really need some help. I have a report of a force close with this stack trace, and I cant find any information on how to prevent, nor can I replicate this type of error. I was hoping someone would have some insight on why this is happening. com.google.googlenav.map.Tile.getTile(Unknown Source) com.google.googlenav.map.Tile.read(Unknown Source) com.google.googlenav.map.MapTile.read(Unknown Source) com.google.googlenav.map.FlashRecord.loadTileFromDataEntry(Unknown Source) com.google.googlenav.map.FlashRecord.loadTile(Unknown Source) com.google.googlenav.map.MapFlashService.loadFlashRecordTile

Unable to implement onTouchEvent (Drag & Drop) with Osmdroid

[亡魂溺海] 提交于 2019-12-02 05:14:05
问题 I had been trying to implement OnTouchEvent so I can react when an user move (drag & drop) an overlayitem. I found something similar on the Osmdroid site: http://code.google.com/p/osmdroid/issues/detail?id=225. I am using the code there as reference but still is not working for me and then my application is crashing when it get to the hitTest. Any suggestion? Thanks. public boolean onTouchEvent(MotionEvent event, MapView mapView) { final int action = event.getAction(); final int x = (int)