记一次ArcGis地图挖的坑

发布于 / 代码分享 / 3 条评论

需求:撒点后,点击调用ajax,替换content

尝试了方案往content里丢一个隐藏的div,然后赋值

然后坑爹的就来了,信息疯狂被重置

然后就懵了。。。

最后一筹莫展的时候灵感大爆发,想到了世界上最好用的console.log,我把featureLayer打印出来,找到了content
然后顺藤摸瓜找到了对应的方法
featureLayer.infoTemplate.setContent(网页文本);

成功解决问题,再次提醒自己,多用console.log没毛病,尤其是arcgis这个坑爹的玩应

以下是监控featureLayer的Onclick事件,以及重新赋值的事件


featureLayer.on("click", function (e) {
                $.ajax({
                    url: "TestUrl.aspx",
                    type: "post",
                    data: { ADDR: '测试' },
                    success: function (data) { 
                        featureLayer.infoTemplate.setContent(data);
                    }
                });
                
            });
转载原创文章请注明,转载自: 大鱼的博客 » 记一次ArcGis地图挖的坑
  1. avatar

    Pretty! This has been a really wonderful article. Thanks for supplying these details. Koressa Brendin Pratt

  2. avatar

    Yea, how horrible of a move that was for me knowing the wife, the children, the wife’s
    family! Accredited by the non-profit National Association of Professional Background Screeners, Employment Screening Resources provides
    the security of knowing you are working with
    a reputable company. Make love of him back I had all
    she added security guard down between her body came over the next time.
    Been able to see that ladyboy review did have any errors, and lick down there I moved faster
    for covers back for that almost fully, slid off her even more shemale
    and trannies webcam touched his head of man. These are just some of the questions many people are asking
    about this mysterious man. It is both the man and a woman’s
    job to understand what the other needs and when they need it.
    In fact, the only downside to petroleum jelly is the fact that you will need to clean it up afterwards.
    You only need to make everything perfect and mutual sympathy will
    eventually grow into love which, if you want, will lead you to the
    Altar.

    Here is my blog: chattrube

  3. avatar

    You have a quality site, I congratulate you on this

    http://www.nevale.info/