标签: infowindow

Google Maps Android API v2 - 交互式InfoWindow(与原版Android谷歌地图一样)

InfoWindow点击带有新Google Maps API v2的标记后,我正在尝试制作自定义.我希望它看起来像谷歌的原始地图应用程序.像这样:

示例图像

当我在ImageButton里面时,它不起作用 - 整个InfoWindow选择而不仅仅是ImageButton.我读到这是因为它View本身没有,但它是快照,所以不能区分各个项目.

编辑:文档中(感谢Disco S2):

正如上一节关于信息窗口中所提到的,信息窗口不是实时视图,而是视图在地图上呈现为图像.因此,您在视图上设置的任何侦听器都将被忽略,并且您无法区分视图各个部分上的单击事件.建议您不要在自定义信息窗口中放置交互式组件(如按钮,复选框或文本输入).

但如果谷歌使用它,必须有一些方法来实现它.有谁有想法吗?

android google-maps infowindow google-maps-android-api-2

189
推荐指数
3
解决办法
12万
查看次数

带有Infowindows的Google Maps API多个标记

我正在尝试添加多个标记,每个标记都有自己的infowindow,点击时会出现.当我尝试让它出现时,我遇到了麻烦,当我尝试它时,它只显示一个没有信息的标记.

谢谢,如果您需要更多信息,请与我们联系

<meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
<style type="text/css">
html {
    height: 100%
}

body {
    height: 100%;
    margin: 0;
    padding: 0
}

#map_canvas {
    height: 100%
}
</style>
<script type="text/javascript"
    src="http://maps.googleapis.com/maps/api/js?key=AIzaSyB1tbIAqN0XqcgTR1-FxYoVTVq6Is6lD98&sensor=false">
</script>
<script type="text/javascript">

var locations = [
    ['loan 1', 33.890542, 151.274856, 'address 1'],
    ['loan 2', 33.923036, 151.259052, 'address 2'],
    ['loan 3', 34.028249, 151.157507, 'address 3'],
    ['loan 4', 33.80010128657071, 151.28747820854187, 'address 4'],
    ['loan 5', 33.950198, 151.259302, 'address 5']
];

function initialize() {

    var myOptions = {
        center: new google.maps.LatLng(33.890542, 151.274856), …
Run Code Online (Sandbox Code Playgroud)

javascript google-maps infowindow google-maps-api-3 google-maps-markers

83
推荐指数
3
解决办法
15万
查看次数

如何删除默认标记?

我正在使用谷歌地图API V3,我注意到有很多标记在这里,即使我不需要它们.例如,某些学校或InfoWindows在点击它们时出现的其他地方.

有什么方法可以删除它们,还是不可能?

google-maps infowindow google-maps-api-3 google-maps-markers

54
推荐指数
2
解决办法
5万
查看次数

使用Google Maps API v3禁用兴趣点信息窗口

我有一个带有信息气泡和自定义标记的自定义地图.当我放大兴趣点,如公园和大学出现,当我点击信息窗口打开.如何禁用信息窗口?

我的代码如下:

var geocoder;
var map;
var infoBubble;
var dropdown = "";
var gmarkers = [];

var hostel_icon = new google.maps.MarkerImage('/resources/hostel_blue_icon.png',
new google.maps.Size(28,32),
new google.maps.Point(0,0),
new google.maps.Point(14,32));

var bar_icon = new google.maps.MarkerImage('/resources/bar_red_icon.png',
new google.maps.Size(28,32),
new google.maps.Point(0,0),
new google.maps.Point(14,32));

var icon_shadow = new google.maps.MarkerImage('/resources/myicon_shadow.png',
new google.maps.Size(45,32),
new google.maps.Point(0,0),
new google.maps.Point(12,32));

var customIcons = {
    hostel: {
        icon: hostel_icon,
        shadow: icon_shadow
    },
    bar: {
        icon: bar_icon,
        shadow: icon_shadow
    }
};

function initialize() {
    var latlng = new google.maps.LatLng(12.82364, 26.29987);
    var myMapOptions = …
Run Code Online (Sandbox Code Playgroud)

google-maps infowindow google-maps-api-3

42
推荐指数
4
解决办法
3万
查看次数

自定义信息窗口适配器,具有map v2中的自定义数据

我想在android中的map v2中制作自定义信息窗口适配器,如下所示.

在此输入图像描述

我已经看到下面的链接,但没有得到更多.

1,2,3,

下面是我的内容布局文件.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" 
>
    <ImageView
        android:id="@+id/infocontent_iv_image"
        android:layout_width="150dp"
        android:layout_height="150dp"
        android:layout_alignParentTop="true" 
    />
    <RelativeLayout
        android:id="@+id/infocontent_rl_middle"
        android:layout_below="@id/infocontent_iv_image"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" 
        android:layout_margin="5dp"
    >

    </RelativeLayout>
    <TextView
        android:id="@+id/infocontent_tv_name"
        android:layout_below="@id/infocontent_rl_middle"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textStyle="bold" 
        android:layout_margin="5dp"
    />
    <TextView
        android:id="@+id/infocontent_tv_type"
        android:layout_below="@id/infocontent_tv_name"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textColor="#CCCCCC"
        android:layout_margin="5dp"
    />
    <TextView
        android:id="@+id/infocontent_tv_desc"
        android:layout_below="@id/infocontent_tv_type"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="5dp"
    />
    <TextView
        android:id="@+id/infocontent_tv_addr"
        android:layout_below="@id/infocontent_tv_desc"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="5dp"
    />
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

所以任何人都可以帮助我如何将数据设置为infowindow适配器中的所有视图?

android infowindow android-maps-v2

41
推荐指数
2
解决办法
8万
查看次数

添加标记Google Maps v2 Android时自动打开InfoWindow

有没有办法在我们添加标记时自动打开infowindow?使用此代码添加标记但仅在单击标记时打开信息窗口:

myMap.addMarker(new MarkerOptions()
            .position(latLng)
            .title("Title")
            .snippet("Snippet")
            .icon(BitmapDescriptorFactory
                    .fromResource(R.drawable.marker)));
Run Code Online (Sandbox Code Playgroud)

android infowindow marker google-maps-android-api-2

37
推荐指数
1
解决办法
5万
查看次数

检查infowindow是否已打开Goog​​le Maps v3

拜托,我需要帮助.

我想检查一下我的信息窗是否打开了.

例如:

if (infowindow.isOpened)
{
   doSomething()
}
Run Code Online (Sandbox Code Playgroud)

要么

if (infowindow.close)
{
   doAnotherthing();
}
Run Code Online (Sandbox Code Playgroud)

我不知道怎么做

infowindow google-maps-api-3

33
推荐指数
3
解决办法
3万
查看次数

标记内容(infoWindow)谷歌地图

我正在尝试将infoWindow添加到Google地图上的多个标记中.我最接近的是让infoWindow在所有标记上显示数组中可以看到的最后一个地址.我在下面粘贴的代码不起作用,我得到一个"Uncaught TypeError:无法读取未定义的属性'4'".我确定这是一个范围问题,但我在这里绕圈子可以做一些帮助:

var hotels = [
            ['ibis Birmingham Airport', 52.452656, -1.730548, 4, 'Ambassador Road<br />Bickenhill<br />Solihull<br />Birmingham<br />B26 3AW','(+44)1217805800','(+44)1217805810','info@ibisbhamairport.com','http://www.booknowaddress.com'],
            ['ETAP Birmingham Airport', 52.452527, -1.731644, 3, 'Ambassador Road<br />Bickenhill<br />Solihull<br />Birmingham<br />B26 3QL','(+44)1217805858','(+44)1217805860','info@etapbhamairport.com','http://www.booknowaddress.com'],
            ['ibis Birmingham City Centre', 52.475162, -1.897208, 2, 'Ladywell Walk<br />Birmingham<br />B5 4ST','(+44)1216226010','(+44)1216226020','info@ibisbhamcity.com','http://www.booknowaddress.com']
        ];

        for (var i = 0; i < hotels.length; i++) {
            var marker = new google.maps.Marker({
                position: new google.maps.LatLng(hotels[i][1], hotels[i][2]),
                map: map,
                icon: image,
                title: hotels[i][0],
                zIndex: hotels[i][2]
            });

            var infoWindow = new google.maps.InfoWindow();

            google.maps.event.addListener(marker, 'click', …
Run Code Online (Sandbox Code Playgroud)

javascript google-maps infowindow google-maps-markers

31
推荐指数
2
解决办法
10万
查看次数

Google Map Infowindow无法正常显示

单击标记时,infowindow在我的地图上显示不正确.该网站在这里.

您还会注意到地图控件也未正确显示.

    var map;
    var locations = <?php print json_encode(di_get_locations()); ?>;
    var markers = []
    jQuery(function($){
        var options = {
            center: new google.maps.LatLng(51.840639771473, 5.8587418730469),
            zoom: 8,
            mapTypeId: google.maps.MapTypeId.ROADMAP
        };
        map = new google.maps.Map(document.getElementById("map_canvas"), options);

        for (var i=0; i < locations.length;i++) {
            makeMarker(locations[i]);
        }
        centerMap();

    });
    function makeMarker(location) {
        var markerOptions = {map: map, position: new google.maps.LatLng(location.lat, location.lng)};
        var marker = new google.maps.Marker(markerOptions);
        markers.push(marker);
        var content = '';

        var infowindow = new google.maps.InfoWindow(
          { content: "test",
            size: new google.maps.Size(50,50),
            disableAutoPan : …
Run Code Online (Sandbox Code Playgroud)

google-maps infowindow google-maps-api-3

28
推荐指数
1
解决办法
2万
查看次数

Android Google Map API V2:打开Marker右侧的自定义信息窗口

我已经为Android集成了Google MAP API V2.我希望在My Marker的Onclick上有一个自定义信息窗口.到目前为止还可以.我整合了它.

我想要的是:我想在标记的右侧显示我的自定义信息窗口而不是标记的顶部.

以下是我正在使用的代码:

public class MainActivity extends FragmentActivity {

    private MainMapFragement mapFragment;
    private HashMap<Marker, EventInfo> eventMarkerMap;


    Marker ThirdMarker;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mapFragment = new MainMapFragement();
        // FragmentTransaction ft = getFragmentManager().beginTransaction();
        FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
        ft.add(R.id.map, mapFragment);
        ft.commit();

    }

    @Override
    protected void onStart() {
        super.onStart();
        setUpEventSpots();
    }

    private void setUpEventSpots() {
        // I'm going to make 2 EventInfo objects and place them on the map
        EventInfo firstEventInfo = new EventInfo(new LatLng(50.154, …
Run Code Online (Sandbox Code Playgroud)

android google-maps infowindow android-maps-v2

28
推荐指数
2
解决办法
1万
查看次数