English 中文(简体)
添加一个标记点和一线大小,以图标3
原标题:Adding ancor point and icon size to map marker with gmap3

我正在使用格图3,并在我的地图上添加了习俗带和 shadow子,但我却在把icon和阴影调和方面遇到问题。 我的法典是:

marker: {
  options: {
    icon:  /media/pins/pin.png ,
    iconSize: [26, 30],
    shadow:  /media/pins/pin_shadow.png ,
    shadowSize: [44, 30],
    iconAnchor: [13, 70],
  },

未能在网上找到任何例子,因此,我无法确定问题是否与我所说的选择(如:一刀切)或我如何为之服务(ex:[13, 70])

最佳回答

正如邓肯指出的,解决办法是使用MarkerImage级。 这样做的方法是:

marker: {
  options: {
    icon:
      new google.maps.MarkerImage( /media/pins/pin.png ,   //icon url
      new google.maps.Size(26, 30),    //sets the icon size
      new google.maps.Point(0, 0),    //sets the origin point of the icon
      new google.maps.Point(13, 30)),    //sets the anchor point for the icon
    shadow:
      new google.maps.MarkerImage( /media/pins/pin_shadow.png ,
      new google.maps.Size(44, 30),
      new google.maps.Point(0, 0),
      new google.maps.Point(13, 30)),
  },
问题回答

标记法没有一刀切、影子或单.。 很难说,如果图3将选择和插图直接输入标识。 如果是,你需要将icon和影子建成MarkerImage





相关问题
How to decide the current point reach on google map?

How to decide the current point reach on google map? I have a list of points (pickup points) of a route that I want to show in my google map with polyline. Now i have to get the current location of ...

Topographical or relief data in Map APIs

I was wondering if anyone knew of any map APIs that offer topographical or relief data? I ve had a quick look at Google and Bing APIs, but could find nothing there. Google allow you to view a map as ...

Using maps on Windows Mobile

I m experimenting with maps on different mobile platforms. Getting Google Maps to work on Android was easy, following this tutorial. Getting the same to work on Windows Mobile is a different matter. ...

Adding a custom icon to a google map

I need a hand adding a custom icon to some Google Maps javascript. Code below for your reference: function populateMap() { var map = new GMap2(document.getElementById("map")); map.setCenter(new ...

RSS to KML Overlay

I m want to display my blog as a Google Map overlay (each post contains geotags). How can I dynamically create a KML overlay from an RSS? Or better, how can I create a loop (PHP) that would display ...

开放街道地图管理员

我需要开放Street的标记管理员。 地图,如山角地图。

热门标签