如何在我的小程序中使用Google Terrain Provider

时间:2019-12-28 20:50:51

标签: google-maps applet recaptcha access-denied

我正在尝试使用“展开地图”功能,该功能使用Google地图。问题是Google不允许我这样做。我得到的错误如下所示。经过研究后,我发现Google当然可以确定我是试图访问Google Maps的机器人还是抓取工具。尽管它也说您的计算机程序。但是,它仍然没有提供任何解决方案。 在这种不必要和不相关的障碍产生之后,应该如何学习?

 package module1;

import processing.core.PApplet;
import de.fhpotsdam.unfolding.UnfoldingMap;
import de.fhpotsdam.unfolding.geo.Location;
import de.fhpotsdam.unfolding.providers.AbstractMapProvider;
import de.fhpotsdam.unfolding.providers.Google;
import de.fhpotsdam.unfolding.providers.MBTilesMapProvider;
import de.fhpotsdam.unfolding.utils.MapUtils;




 public class HelloWorld extends PApplet
    {



        private static final long serialVersionUID = 1L;


        public static String mbTilesString = "blankLight-1-3.mbtiles";


        private static final boolean offline = false;

        /** The map we use to display our home town: La Jolla, CA */
        UnfoldingMap map1;

        /** The map you will use to display your home town */ 
        UnfoldingMap map2;

        public void setup() {
            size(800, 600, P2D);  /

            // This sets the background color for the Applet.  
            // Play around with these numbers and see what happens!
            this.background(200, 200, 200);

            // Select a map provider
            AbstractMapProvider provider = new Google.GoogleTerrainProvider();
            // Set a zoom level
            int zoomLevel = 10;

            if (offline) {

                provider = new MBTilesMapProvider(mbTilesString);

                zoomLevel = 3;

            }

            map1 = new UnfoldingMap(this, 50, 50, 350, 500, provider);

            // The next line zooms in and centers the map at 
            // 32.9 (latitude) and -117.2 (longitude)
            map1.zoomAndPanTo(zoomLevel, new Location(32.9f, -117.2f));

            // This line makes the map interactive
            MapUtils.createDefaultEventDispatcher(this, map1);

            // TODO: Add code here that creates map2 
            // Then you'll modify draw() below
            map2 = new UnfoldingMap(this, 450 , 50, 350, 500, provider);
            map2.zoomAndPanTo(zoomLevel, new Location(17.6f, 75.9f));
            //MapUtils.createDefaultEventDispatcher(this, map2);

        }
        /** Draw the Applet window.  */
        public void draw() {
            // So far we only draw map1...
            // TODO: Add code so that both maps are displayed
            map1.draw();
            map2.draw();
        }
}

为什么会出现此错误 下面是错误。

The file "http://mt1.google.com/vt/v=w2p.116&hl=de&x=180&y=414&z=10&s=Galileo" is missing or inaccessible, make sure the URL is valid or that the file has been added to your sketch and is readable.

转到提到的网站后,谷歌表示这是一个禁止我使用地图功能的刮板程序,机器人程序。如何使用地图功能?有什么我应该做的设置吗?

0 个答案:

没有答案