谷歌地图自定义地图 [英] Google map custom map

查看:233
本文介绍了谷歌地图自定义地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,

我对Google地图非常陌生.我正在使用Google Map创建一个应用程序.我想在上面显示我的自定义地图.因此,我使用了图像叠加层并设置了边界.图像显示正常.但是问题是我只想显示我的自定义地图,而不显示该自定义地图以外的区域.意味着我想将地图上的可见区域固定到自定义图像的边界,我该怎么做.请帮助我

imageBounds是:

Hello friends,

I am very new for google maps. I am creating an application using google map. I want to show my custom map over it. So I used image overlay and set it''s bounds. Image is showing ok. but problem is this I want to show only my custom map, but not area other that custom map. means I want to fix the visible area on map to the bounds of my custom image how can I do this. please help me

imageBounds are:

var imageBounds = new google.maps.LatLngBounds(
        new google.maps.LatLng(40.716216,-74.213393),
        new google.maps.LatLng(40.765641,-74.139235)
    );


在此先谢谢您.


Thanks in advance.

推荐答案

除非您要在地图上放置图像的区域的大小与您缩放级别的图块的大小相同"再次,您真不走运.

您也许可以使用PNG图片作为框架,然后将其与CSS一起遮盖"您不喜欢的区域(但是我不确定这是否符合Google条款)使用...先检查一下.)

您的另一个选择是创建比您正在查看的缩放级别显示的区域更大的图像.

干杯.
Unless the area that you''re trying to lay an image over maps to the same size as the tiles for the zoom level you''re at, you''re out of luck.

You might be able to use a PNG image as a frame and place it with CSS to ''mask'' out the areas you don''t like (but I''m not fully sure if this is in adherence with the Google terms of use...check that out first).

Your other option would be to create an image bigger than the area revealed at the zoom level you''re viewing.

Cheers.


这篇关于谷歌地图自定义地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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