backwardm
backwardm

Reputation: 309

How to show a marker with Google Maps API v3 + my own map tiles

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.org/map.html

Upvotes: 0

Views: 6282

Answers (1)

Jiri Kriz
Jiri Kriz

Reputation: 9292

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

Upvotes: 6

Related Questions