google-maps-api-2

How to Focus at Marker in google map in android

痴心易碎 提交于 2019-12-03 09:02:00
I just want to know whether we can focus at added marker in android application or not. If yes, how? or is there any alternative way to get this task done. lets say I have added a marker using below code : map.addMarker(new MarkerOptions() .title(title) .snippet(snippet) .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_BLUE)) .position(pos) ); how to focus at this marker with maximum zoom. and if I will add 1 more marker it should adjust zooming(maximum possible zoom) in such a way so that both marker will display at once. This is what I am trying to do but it is failing

how to load image with Universal ImageLoader without displaying

匆匆过客 提交于 2019-12-03 08:55:49
I'm trying to do something like this: Android Map api v2 Custom marker with ImageView But I'm stuck on using image loader. Trying: Bitmap bmImg = imageLoader.loadImageSync(url); LogCat gives me 04-13 14:11:44.953: E/ImageLoader(18542): android.os.NetworkOnMainThreadException Here's is my code. I have an ArrayList camera with all information needed (titrle, position, url, etc). public void drawPicsOnMap() { String title = null; String place = null; for (int i = 0; i<camera.size(); i++) { Bitmap.Config conf = Bitmap.Config.ARGB_8888; Bitmap bmp = Bitmap.createBitmap(80, 80, conf); Canvas canvas

Blurred custom tiles on Android Maps V2

爱⌒轻易说出口 提交于 2019-12-03 08:29:10
I want to show a CustomOverlay on a Google Maps V2. The loading of the tiles works as expected, the only thing is, that the shown tiles are not appearing to be sharp at all, kind of blurry. Google did not get me to an usable answer. I took the approach of adding classical 256px x 256px tiles for the TileProvider. I managed to get a tile source where the images were @2x (retina), which made the whole visual experience much sharper, but I would rather not use this source, as the data transfer rate is four times higher, hence not usable on mobile devices and slow internet speeds. I included two

How to color countries using google maps?

风流意气都作罢 提交于 2019-12-03 06:53:06
I need to color different countries in the world based on a Range (eg: population) Red : > 100 million Green: 50 - 99 million Ash : < 50 million How can this be done. My development environment is Rails3. Please help I will attach a sample image how the map should look Use Google Charts API, not Google Maps API. It has a chart type of map which will allow you to very easily plot data by country and color-code them, e.g. http://code.google.com/apis/chart/interactive/docs/gallery/geochart.html#Example Hi you might find following example useful, it uses google charts and sets different colors per

Fixed Legend in Google Maps Mashup

不问归期 提交于 2019-12-03 02:58:40
I have a page with a Google Maps mashup that has pushpins that are color-coded by day (Monday, Tuesday, etc.) The IFrame containing the map is dynamically sized, so it gets resized when the browser window is resized. I'd like to put a legend in the corner of the map window that tells the user what each color means. The Google Maps API includes a GScreenOverlay class that has the behavior that I want, but it only lets you specify an image to use as an overlay, and I'd prefer to use a DIV with text in it. What's the easiest way to position a DIV over the map window in (for example) the lower

How to display a moving track on Android device

我们两清 提交于 2019-12-03 00:35:13
I want to plot my track using GPS on an Android device. I have no problem displaying a completed route but am finding it difficult to show the track as I'm moving. So far, I've found 2 different ways to do that but neither are particularly satisfactory. METHOD 1 PolylineOptions track = new PolylineOptions(); Polyline poly; while (moving) { Latlng coord = new LatLng(lat,lng); // from LocationListener track.add(coord); if (poly != null) { poly.remove(); } poly = map.addPolyline(track); } ie build up the polyline removing it before adding the new coordinates and then adding it back. This is

Best way to geocode UK postcode with Google Maps API?

拈花ヽ惹草 提交于 2019-12-03 00:26:37
What is the most effective and accurate way to geocode a UK postcode? Using the built in geocode object results in massively blurred results (lots of postcodes returning just a general area). Are there any free UK postcode geocoding services I can plug into via JavaScript? Edit: To be clearer this uses the local search in google search api, not the google maps api to do the geocoding which is much more accurate. The best way is to use Google Search Api. If you get an api key and get it all setup: http://code.google.com/apis/ajaxsearch/ var localSearch; var map; var icon; var

How to create circle in google map v3 with same radius in all zoom level?

对着背影说爱祢 提交于 2019-12-02 22:23:07
I am working on map code migration from v2 to v3. In v2 i have create circle with help of GProjection and Overlay and it will look same size in all zoom level. In v3 google gives Circle class that will create circle in map but it will change in different zoom level. I want to create circle that will have same size in all zoom level. I want to know any other way in google map v3 by that i can create circle with same size for all zoom level. Thanks in advance. jlivni To create circles that are the same pixel size on the screen (versus same area size in geographic coordinates), you would

Can you load Google Maps API v3 via Google AJAX API loader

狂风中的少年 提交于 2019-12-02 21:14:09
Some time ago I used the regular method of loading Google Maps API like this: <script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&key=abcdefg&sensor=true"> Later I switched to Google AJAX APIs to load Google Maps API. This was because a couple of "widgets" on my website needed the Google Ajax API loader so I chose to be consistent and used the AJAX APIs to load Google Maps as well: <script type="text/javascript" src="http://www.google.com/jsapi?key=abcdef"></script> <script type="text/javascript"> google.load("maps", "2", {"other_params": "sensor=true"}); </script> Now

error running google maps api v2

与世无争的帅哥 提交于 2019-12-02 18:36:27
问题 I'm using google play services r14 and couldn't able to run the app on any device. 01-23 12:07:37.309: E/AndroidRuntime(7056): FATAL EXCEPTION: main 01-23 12:07:37.309: E/AndroidRuntime(7056): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.mapstest/com.example.mapstest.MainActivity}: java.lang.NullPointerException 01-23 12:07:37.309: E/AndroidRuntime(7056): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2114) 01-23 12:07:37.309: E