小编Hug*_*o H的帖子

将传单地图导出到geojson

是否可以从传单中导出geojson以保存地图状态?

我想存储标记,缩放和地图中心以在以后加载。

有很多方法可以在传单上加载geojson,但我不知道有任何方法可以将地图导出到geojson ...

javascript dictionary geojson leaflet

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

Google地图地理编码在浏览器中运行,但不是从PHP服务器运行

当我从浏览器中获取Google Maps Geocoding API时,它正在运行,但不是来自我的PHP脚本.

工作:https://maps.google.com/maps/api/geocode/json?appens = false&key = AzazaSyDqIj_SXTf5Z5DgE_cvn5VF9h5NbuaiCbs&address = La%20P%C3%A9relle,%20Saint-Pierre-de-Chartreuse,%20France

退货:

{
   "results" : [
      {
         "address_components" : [
            {
               "long_name" : "La Pérelle",
               "short_name" : "La Pérelle",
               "types" : [ "colloquial_area", "political" ]
            },
         ],
         "formatted_address" : "La Pérelle, 38380, France",
         // other stuffs
         "partial_match" : true,
         "place_id" : "ChIJZzDRRAX4ikcRnZ-vb1tnTgY",
         "types" : [ "colloquial_area", "political" ]
      }
   ],
   "status" : "OK"
}
Run Code Online (Sandbox Code Playgroud)

不工作:

<?php 
$url = 'https://maps.google.com/maps/api/geocode/json?sensor=false&key=AIzaSyDqIj_SXTf5Z5DgE_cvn5VF9h5NbuaiCbs&address=La%20P%C3%A9relle,%20Saint-Pierre-de-Chartreuse,%20France';
echo file_get_contents($url);
Run Code Online (Sandbox Code Playgroud)

返回:

{
   "results" : …
Run Code Online (Sandbox Code Playgroud)

php google-maps google-geocoding-api

3
推荐指数
2
解决办法
1298
查看次数

Leaflet:在光标位置而不是 LineString 中心打开弹出窗口

我有一张带有 的传单地图LineString

// a GeoJSON LineString
var geojson = {
  "type": "Feature",
  "geometry": {
    "type": "LineString",
    "coordinates": [[-101.123, 40.2500], [-101.123, 40.2503]]
  }
};

// create map and add json
var map = L.map('map');
var geojsonLayer = new L.GeoJSON(geojson).addTo(map);
map.fitBounds(geojsonLayer.getBounds())

// add popup for the line
geojsonLayer.eachLayer(function (layer) {
  var popup = L.popup();
  popup.setContent('text');

  layer.bindPopup(popup);
  layer.on('click mouseover', function () {
    layer.openPopup();
  });
});
Run Code Online (Sandbox Code Playgroud)

当我越过它时,LineString 中心会打开一个弹出窗口。

如何让它在光标位置打开?

这是一个简单的工作示例:http ://jsfiddle.net/wuu8Lv2t/1/

javascript geojson leaflet

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

离子:如何检测底部滚动?

对于聊天应用程序,我想知道我的离子内容是否在底部滚动,仅在用户已经在底部时才添加消息后再次向下滚动.

是否可以轻松检测内容何时滚动?

javascript angularjs ionic-framework

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