如何在WP7上使用Google地图制作导航控件 [英] How to make a Navigation control with google map on WP7

查看:88
本文介绍了如何在WP7上使用Google地图制作导航控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我是学生,正在开发自己的应用程序,以了解如何使用Google map API v3.
我在Windows Phone 7的应用程序中调用了一个名为"Up_pan"的Java脚本函数.

Hi everyone,

I am student and working my own application for knowing how to use Google map API v3.
and i call a Java script function named "Up_pan" from my application on Window phone 7.

function Up_pan() {

    var center = map.getCenter();
    var New_center = { lat: center.lat() + 1,
        lng: center.lng() + 1
    };
    map.panTo(New_center);
}



但它没有用.
请有人帮我.
感谢您的阅读和帮助.



but it did not work.
Please someone help me.
Thank for reading and helping me.

推荐答案

这是我的解决方案.
This is my solution.
function up() {
         var center = map.getCenter();
        var New_center = new google.maps.LatLng(center.lat() + 0.001, center.lng() );
        map.setCenter(New_center);
}


谢谢您的阅读,希望对您有所帮助.


Thx for reading and i hope it will help someone.


我相信它应该看起来像这样:
I believe it should look like this:
function Up_pan() {
  var center = map.getCenter();
  var New_center = new google.maps.LatLng(center.lat() + 1, center.lng() + 1);
  map.panTo(New_center);
}

原因是因为您没有为panTo指定正确的类型.请注意,您的代码使中心在对角线上偏移.

The reason for this is because you weren''t specifiying the right type for panTo. Note that your code is offsetting the center in a diagonal line.


非常感谢.
您的回答对我很有帮助.
Thank a lot.
Your answer helped me a lot.


这篇关于如何在WP7上使用Google地图制作导航控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆