首页 > google-maps > 微信富媒体卡,网址和谷歌地图

微信富媒体卡,网址和谷歌地图 (WeChat Rich Media cards, URLs and Google maps)

问题

我已经针对位置事件构建了Rich Media Card WeChat响应,该位置事件使用Googlemaps网址填充网址参数,其中包含来自位置响应的Lat / long值

像这样

 $return ='<xml>
             <ToUserName><![CDATA[' . $xml->FromUserName . ']]></ToUserName>
             <FromUserName><![CDATA[' . $xml->ToUserName . ']]></FromUserName>
             <CreateTime>' . mktime() . '</CreateTime>
             <MsgType><![CDATA[news]]></MsgType>
             <ArticleCount>1</ArticleCount>
            <Articles>
             <item>
               <Title><![CDATA[Your Location]]></Title> 
               <Description><![CDATA[Click this card to demonstrate the mapping functionality]]</Description>
               <PicUrl><![CDATA[http://www.foo/WeChat/images/map.png]]></PicUrl>
               <Url><![CDATA[https://www.google.com/maps/@'.$xml->Latitude.','.$xml->Longitude.',13z]]></Url>
            </item>
           </Articles>
        </xml>';

正确填充纬度和经度变量

如果我输出的URL很好。然而,当我点击链接微信打开其浏览器并尝试加载URL但没有显示地图。

有没有我错过的东西?

谢谢

解决方法

一切似乎都很好。在iPhone上测试。确保它在WeChat之外的本机浏览器上运行。如果这样做,那么请在此处发布您在本机浏览器和微信中看到的内容以及最终URL的屏幕截图

问题

I've built a Rich Media Card WeChat response to a location event that populates the URL parameter with a Googlemaps URL including the Lat/long values from the location response

like this

 $return ='<xml>
             <ToUserName><![CDATA[' . $xml->FromUserName . ']]></ToUserName>
             <FromUserName><![CDATA[' . $xml->ToUserName . ']]></FromUserName>
             <CreateTime>' . mktime() . '</CreateTime>
             <MsgType><![CDATA[news]]></MsgType>
             <ArticleCount>1</ArticleCount>
            <Articles>
             <item>
               <Title><![CDATA[Your Location]]></Title> 
               <Description><![CDATA[Click this card to demonstrate the mapping functionality]]</Description>
               <PicUrl><![CDATA[http://www.foo/WeChat/images/map.png]]></PicUrl>
               <Url><![CDATA[https://www.google.com/maps/@'.$xml->Latitude.','.$xml->Longitude.',13z]]></Url>
            </item>
           </Articles>
        </xml>';

The Latitude and longitude variables are populated correctly

If i output the URL it is well formed. however when I click the link Wechat opens its browser and attempts to load the URL but no map is displayed.

Is there something I've missed?

Thanks

解决方法

All seems good. Tested on IPhone. Ensure it is working on the native browser outside of WeChat. If that is working then please post a screenshot here of what you are seeing in the native browser and in WeChat as well as the final URL

相似信息