Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3950198
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:35:01+00:00 2026-05-20T01:35:01+00:00

I am for the moment using the vanilla code examples and can’t even get

  • 0

I am for the moment using the vanilla code examples and can’t even get that to work!

I call the create marker using…

overlay = new CustomMarker(new google.maps.LatLng(subitem[2], subitem[3]), mapView);
overlay.setMap(mapView);

And the code for the CustomMarker is

function CustomMarker(latlng,  map) {
google.maps.OverlayView.call(this);

this.latlng_ = latlng;

// Once the LatLng and text are set, add the overlay to the map.  This will
// trigger a call to panes_changed which should in turn call draw.
this.set_map(map);


}


 CustomMarker.prototype = new google.maps.OverlayView();

  CustomMarker.prototype.draw = function() {
var me = this;

// Check if the div has been created.
var div = this.div_;
if (!div) {
  // Create a overlay text DIV
  div = this.div_ = document.createElement('DIV');
  // Create the DIV representing our CustomMarker
  div.style.border = "0px solid none";
  div.style.position = "absolute";
  div.style.paddingLeft = "0px";
  div.style.cursor = 'pointer';

  var img = document.createElement("img");
  img.src = "../../images/tile_images/ship_black_0.png";
  div.appendChild(img);
  google.maps.event.addDomListener(div, "click", function(event) {
    google.maps.event.trigger(me, "click");
  });

  // Then add the overlay to the DOM
  var panes = this.get_panes();
  panes.overlayImage.appendChild(div);
}

// Position the overlay 
var point = this.get_projection().fromLatLngToDivPixel(this.latlng_);
if (point) {
  div.style.left = point.x + 'px';
  div.style.top = point.y + 'px';
}


 };

  CustomMarker.prototype.remove = function() {
    // Check if the overlay was on the map and needs to be removed.
    if (this.div_) {
      this.div_.parentNode.removeChild(this.div_);
      this.div_ = null;
    }
  };

  CustomMarker.prototype.get_position = function() {
   return this.latlng_;
  };

Creating a standard marker using the same LatLng and mapView works fine.

The error I get is

TypeError: Result of expression
‘this.set_map’ [undefined] is not a
function.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T01:35:02+00:00Added an answer on May 20, 2026 at 1:35 am

    It appears that

    this.set_map(map); 
    

    is deprecated and it is now

    this.setMap(map);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Java client that calls a web service at the moment using
I am using in my code at the moment a ReentrantReadWriteLock to synchronize access
does anyone know if you can get individual field comments from mysql using Zend
I am making a little GUI frontend for a app at the moment using
I have a self built JSP webapp and at the moment I'm using tomcats
I am using Oracle 10g at the moment. I want to search through all
I am using VMware Server 1.0.7 on Windows XP SP3 at the moment to
At the moment my code (PHP) has too many SQL queries in it. eg...
I am building a cms at the moment using the zend framework and have
I am hoping that someone can help me with a problem I've got at

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.