google-maps-api-2

Switch between Fragments and MapFragment with NavigationDrawer *FIXED*

落爺英雄遲暮 提交于 2019-12-01 11:54:21
问题 Problem Solved. Scroll further down! Im currently coding an app that has a Navigation Drawer. I want a map in one of the fragments. To switch between fragments in the navigation drawer i have this Switch case: private void displayView(int position) { // update the main content by replacing fragments Fragment fragment = null; switch (position) { case 0: fragment = new SupportMapFragment(); break; case 1: fragment = new PlacesFragment(); break; case 2: fragment = new LogbookFragment(); break;

Google Maps API - Resizing generates blank white space

我只是一个虾纸丫 提交于 2019-12-01 11:39:23
I'm working on what it looked to be like a very simple feature which is causing a little bit of a headache. I work with a GIS and we integrate it with Google Maps. One of the clients requested to be able to open a separate pop up window showing only the map. Opening the window wasn't a problem, but as I try to expand the width of the IFrame which contains the map, in order to fit the window size, the actual map image stays with the same size, and a white space fills the remaining space. I wonder if I have to pass the new width value to some pre-rendering function or something like that... I've

How do I convert my google maps application into a google earth application?

旧城冷巷雨未停 提交于 2019-12-01 11:33:06
On maps.google.com you can see a brilliant example on how a google maps application can suddenly turn into a google earth application smoothly. I'm developing a google maps application, working with API version 3. I read the following line in the Google Earth API summary If you have an existing Maps API site, you can 3D-enable your page with as little as one line of code. But I have searched for hours without finding any clue how to enable 3D in my application. I've built my application on the google.maps.Map constructor and included the google mas API from this url: http://maps.google.com

Why Google Maps is showing empty screen in my Android App?

妖精的绣舞 提交于 2019-12-01 09:30:46
问题 I have Google Maps in my Android App. I added it by selecting new Google Maps Activity & pasting the key in Android Studio. It worked fine in my Android phone (Lenovo K5 Note) but when I copied the project to another computer & run in another device (Coolpad), it shows a blank screen (beige or white colored) with Google logo on bottom left. 回答1: Fought with blank map past two days and here is the summary (which I'm sure is not a complete list of possible issues!) collected from various

How do I convert my google maps application into a google earth application?

感情迁移 提交于 2019-12-01 09:24:19
问题 On maps.google.com you can see a brilliant example on how a google maps application can suddenly turn into a google earth application smoothly. I'm developing a google maps application, working with API version 3. I read the following line in the Google Earth API summary If you have an existing Maps API site, you can 3D-enable your page with as little as one line of code. But I have searched for hours without finding any clue how to enable 3D in my application. I've built my application on

Google Maps v3 map.getBounds().containsLatLng is not a function

怎甘沉沦 提交于 2019-12-01 08:44:55
How do i set the "setMap" function here to port this code to v3? Or port it generally to v3... // map recenter, if element is outside the mapscreen while ((!map.getBounds().containsLatLng(marker.getPosition())) & (showAllCategoryElements == 0)) { var newCenterPointLng = (map.getBounds().getCenter().lng() + marker.getPosition().lng()) / 2; var newCenterPointLat = (map.getBounds().getCenter().lat() + marker.getPosition().lat()) / 2; map.panTo(new google.maps.LatLng(newCenterPointLat, newCenterPointLng)); map.setCenter(new google.maps.LatLng(newCenterPointLat, newCenterPointLng)); if (!map

Google Maps v3 map.getBounds().containsLatLng is not a function

£可爱£侵袭症+ 提交于 2019-12-01 05:49:05
问题 How do i set the "setMap" function here to port this code to v3? Or port it generally to v3... // map recenter, if element is outside the mapscreen while ((!map.getBounds().containsLatLng(marker.getPosition())) & (showAllCategoryElements == 0)) { var newCenterPointLng = (map.getBounds().getCenter().lng() + marker.getPosition().lng()) / 2; var newCenterPointLat = (map.getBounds().getCenter().lat() + marker.getPosition().lat()) / 2; map.panTo(new google.maps.LatLng(newCenterPointLat,

Upgrading to v3 from v2 of google maps API, suggestions

强颜欢笑 提交于 2019-11-30 16:12:23
I have full fledged integration of google maps version 2 in my web application, with features like get directions, cluster markers, tabbed info window, context menu(right click). The implementation has very poor design which is causing some problem, So now I need to revamp the core implementation to better design. I was thinking of upgrading to version 3 of google maps API. Please suggest, if that's a good thing to do and my all features will be running fine(or I will get replacement for all the features mentioned) in less time. Or should I stick to the version 2 of the google maps API? I

android Zoom-to-Fit All Markers on Google Map v2 [closed]

旧巷老猫 提交于 2019-11-30 14:02:43
How to zoom in/out the map view such a way that it cover all markers? i am reviewing sample code of gmap V2 given in sdk. It lays on sdk\extras\google\google_play_services\samples\maps. Thanks in advance. Try using LatLngBounds : LatLngBounds.Builder builder = new LatLngBounds.Builder(); builder.include(Latlng1); builder.include(Latlng2); LatLngBounds bounds = builder.build(); map.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, 20)); 来源: https://stackoverflow.com/questions/16414820/android-zoom-to-fit-all-markers-on-google-map-v2

Google Maps API open multiple info windows by default

泄露秘密 提交于 2019-11-30 10:00:26
问题 Is it possible to open all info windows by default. I tried the following but it doesn't work: var infowindow = new google.maps.InfoWindow({ maxWidth: 160 }); // Add the markers and infowindows to the map for (var i = 0; i < locations.length; i++) { marker = new google.maps.Marker({ position: new google.maps.LatLng(locations[i][1], locations[i][2]), map: map, icon: icons[iconCounter] }); infowindow.setContent(locations[i][0]); infowindow.open(map, marker); } 回答1: Your code only includes one