小编Lew*_*ley的帖子

将google.maps.latlng添加到循环内的数组中

这是我在地图上绘制多边形的代码......这不起作用.请告诉我我做错了什么.

如果我像这样手动添加点数:

points.push(new google.maps.LatLng(51.35020072, -2.978521717));
points.push(new google.maps.LatLng(51.35047285, -2.971755353));
points.push(new google.maps.LatLng(51.34943740, -2.969097019));
Run Code Online (Sandbox Code Playgroud)

而不是使用循环它工作正常.有任何想法吗?

    function drawpolygon(areaid) {

    var points = []; 

    $.ajax({
        type: "POST",
        contentType: "application/json; charset=utf-8",
        url: "polygons.asmx/GetPolygonsByArea",
        data: '{ id: "' + areaid + '" }',
        dataType: "json",
        success: function (msg) {
            var c = eval(msg.d);
            for (var i in c) {

                var lat = parseFloat(c[i][1]);
                var lng = parseFloat(c[i][2]);

                points.push(new google.maps.LatLng(lat, lng));

            }
        }
    });

    var Area;

    Area = new google.maps.Polygon({
        paths: points,
        strokeColor: "#204F68",
        strokeOpacity: 0.8,
        strokeWeight: 2, …
Run Code Online (Sandbox Code Playgroud)

javascript google-maps google-maps-api-3

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

如何从 Mailgun 在 ASP.NET C# 中接收 HTTP POST?

http://documentation.mailgun.net/quickstart.html包含 Django 中 http 处理程序的一些示例代码:

    # Handler for HTTP POST to http://myhost.com/messages for the route defined above
    def on_incoming_message(request):
    if request.method == 'POST':
     sender    = request.POST.get('sender')
     recipient = request.POST.get('recipient')
     subject   = request.POST.get('subject', '')

     body_plain = request.POST.get('body-plain', '')
     body_without_quotes = request.POST.get('stripped-text', '')
     # note: other MIME headers are also posted here...

     # attachments:
     for key in request.FILES:
         file = request.FILES[key]
         # do something with the file

 # Returned text is ignored but HTTP status code matters:
 # Mailgun wants to …
Run Code Online (Sandbox Code Playgroud)

.net c# http webhooks

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

标签 统计

.net ×1

c# ×1

google-maps ×1

google-maps-api-3 ×1

http ×1

javascript ×1

webhooks ×1