小编Eri*_*rgo的帖子

Google Maps API v3与自定义图标的兴趣点

我有一个页面拉着我给定区域的学校,教堂和公园,但我想用3个不同的图标设计3个POI.我搜索了Google甚至所有文档,但找不到答案.

var map;
var infowindow;

function initialize() {

  // Center of Map
  var centerLatlng = new google.maps.LatLng(29.745376, -95.380125);

  // Marker Icons Declaration
  var icon = new google.maps.MarkerImage("smLinks-twitter.png", null, null, new google.maps.Point(41,47));

  // Map Options
  var myOptions = {
    zoom: 16,
    center: centerLatlng,
    mapTypeId: google.maps.MapTypeId.ROADMAP,
    icons: icon 
  };

  // Draw the map
  map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

  // Marker Icons Implementation
  markers = new google.maps.Marker({ 
    position: centerLatlng,
    map: map, 
    title: 'Center of Map', 
    icon: icon 
  });

  // Services: Places
  var request …
Run Code Online (Sandbox Code Playgroud)

google-maps

8
推荐指数
1
解决办法
1万
查看次数

标签 统计

google-maps ×1