You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Gmap3中使用卫星地图?网站Gmap3切换卫星地图技术咨询

Switching to Satellite Map in Gmap3

Got it, let's get your Gmap3 instance showing satellite imagery instead of that custom shade of grey map. Since Gmap3 wraps the Google Maps JavaScript API, we just need to adjust a few parameters in your initialization code. Here's how:

Key Changes to Make

  • Replace the custom map type with Google's satellite option: Google Maps offers two satellite-related map types:
    • google.maps.MapTypeId.SATELLITE: Pure satellite imagery (no road labels)
    • google.maps.MapTypeId.HYBRID: Satellite imagery with overlaid road labels and place names
  • Update the available map types list: If you want to let users switch between map types later, make sure the satellite type is included in the mapTypeIds array. If you don't need the custom shadeOfGrey map anymore, you can remove it entirely.

Modified Code Example

$('.map').gmap3({
  center:[37.7638886, -122.4563572],
  zoom:14,
  scrollwheel: false,
  mapTypeControl: false, // Keep this false if you don't want users to switch map types; set to true if you do
  streetViewControl: false,
  mapTypeId: google.maps.MapTypeId.SATELLITE, // Sets satellite as the default map type
  mapTypeControlOptions: {
    mapTypeIds: [google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.SATELLITE] // Include only the map types you want available
  }
});

Quick Notes

  • If you prefer hybrid view, just swap out google.maps.MapTypeId.SATELLITE with google.maps.MapTypeId.HYBRID in both the mapTypeId and mapTypeIds array.
  • If you’re sticking with only satellite view (and don’t need the map type control), you can simplify the code further by removing the mapTypeControlOptions block entirely—since mapTypeControl is set to false, users won’t see the switcher anyway.
  • Don’t forget to remove any code you had defining the custom shadeOfGrey map type if you’re no longer using it.

内容的提问来源于stack exchange,提问作者Md Shahnur Sarder

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.22 09:23:35