最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to show a marker with Google Maps API v3 + my own map tiles - Stack Overflow

programmeradmin1浏览0评论

I've used the Google maps API v3 to display a map of the Rice Eccles Stadium floor plan at the University of Utah (where we hold our district science fair called Salt Lake Valley Science & Engineering Fair), I'd like to show a marker for a given table number so judges can find the project they are judging. For the life of me, I can't get a single marker to show up. I've tried adding the zIndex parameter, changing the style, etc. Can someone please give me a ticket to the Clue Train? Thank you.

Here's the page showing my floor plan: .html

I've used the Google maps API v3 to display a map of the Rice Eccles Stadium floor plan at the University of Utah (where we hold our district science fair called Salt Lake Valley Science & Engineering Fair), I'd like to show a marker for a given table number so judges can find the project they are judging. For the life of me, I can't get a single marker to show up. I've tried adding the zIndex parameter, changing the style, etc. Can someone please give me a ticket to the Clue Train? Thank you.

Here's the page showing my floor plan: http://slvsef/map.html

Share Improve this question edited Dec 9, 2013 at 4:10 Kara 6,22616 gold badges53 silver badges58 bronze badges asked Sep 27, 2011 at 3:31 backwardmbackwardm 3093 silver badges6 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 6

You do not match brackets {...} correctly in your function initialize(). See REMOVE/ADD lines below:

function initialize() {
    var myLatlng = new google.maps.LatLng(0, 0);    
    var myOptions = {
      center: myLatlng,
      zoom: 2,
      streetViewControl: false,
      mapTypeControl: false,
      panControl: false 
    };  
    var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
    map.mapTypes.set('slvsef', MapType);
    map.setMapTypeId('slvsef');

    // }    <=====    REMOVE

    var marker = new google.maps.Marker({
      position: new google.maps.LatLng(0,0), 
      map: map, 
      title:"Hello World!"
    });    
} // <===== ADD
发布评论

评论列表(0)

  1. 暂无评论