小编Ryl*_*ton的帖子

Google映射apiv3'click'和'dragend'单个监听器

通过点击工作我的代码来检索lat,它工作正常.想知道是否可以在单个事件监听器中组合"click"和"dragend",如果没有.会不会感到有什么选择.

这就是我一直在努力的方面.

google.maps.event.addListener(map,'click', function(event) {
    document.getElementById("latbox").value = event.latLng.lat();
    document.getElementById("lngbox").value = event.latLng.lng();
    addMarker(event.latLng);
  });
}

 function addMarker(location) {

if (!marker) {

    marker = new google.maps.Marker({
    position: location,
    map: map,
    draggable:true,
    animation: google.maps.Animation.DROP
    });
}
// Otherwise, simply update its location on the map.
else { marker.setPosition(location); }
 }
Run Code Online (Sandbox Code Playgroud)

我试过这样做google.maps.event.addListener(map,'click','dragend', function(event)但无济于事.如果有人有想法修改它marker.setPosition(location);animation: google.maps.Animation.DROP..提前致谢.

javascript google-maps-api-3

6
推荐指数
1
解决办法
4867
查看次数

PHP条件语句

嗨,有人可以在我的条件声明中帮助我做错了.

if(isset($_GET['input'] or $_GET['input2'] or $_GET['input3']))
{
  $release=$_GET['input'].$_GET['input2'].$_GET['input3'];
  echo $release;
}
Run Code Online (Sandbox Code Playgroud)

编辑:错误是 syntax error, unexpected T_LOGICAL_OR, expecting ',' or ')'

php

0
推荐指数
1
解决办法
212
查看次数

标签 统计

google-maps-api-3 ×1

javascript ×1

php ×1