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 4530658
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T13:49:28+00:00 2026-05-21T13:49:28+00:00

I found this great tutorial for extending GMarkers in v2 google maps: http://www.googlemapsbook.com/2007/01/22/extending-gmarker/ Unfortunately,

  • 0

I found this great tutorial for extending GMarkers in v2 google maps: http://www.googlemapsbook.com/2007/01/22/extending-gmarker/

Unfortunately, in v3 the set-up of a marker is very different (eg you have to pass in the map it will be added to as a parameter, so can’t have a standalone google.maps.Marker object to act as a prototype, or at least not until after your map has initialised).

Does anyone know how to extend a google maps v3 marker?

*edit – turns out I was wrong about the map being a required parameter. I’ll post my v3 extension as an answer later and mark this as a community question

  • 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-21T13:49:29+00:00Added an answer on May 21, 2026 at 1:49 pm

    Below is what I eventually used (I’ve stripped out a lot of code that I used for my custom marker to leave just the bare bones so I may have made a mistake in the editing). newObj() is a function (based on Douglas Crockford’s code) for generating a new object from a prototype, rather than using a constructor function.

    function newObj(o) {
        var params = Array.prototype.slice.call(arguments,1);
        function F() {}
        F.prototype = o;
        var obj = new F();
        if(params.length) {
            obj.init.apply(obj,params);
        }
        return obj;
    }
    
    var MyMarkerProto = function() {
        var proto  = new google.maps.Marker(new google.maps.LatLng(0, 0));
    
        proto.init = function (data) {
            this.setPosition(new google.maps.LatLng(parseFloat(data.lat), parseFloat(data.lng)));
        }
        return proto;
    
    }();
    
    var myMarker = newObj(MyMarkerProto, {
        lat: 51,
        lng: 48,
        otherData: "some other value"
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I found a great tutorial on performing a faceted search. http://www.devatwork.nl/articles/lucenenet/faceted-search-and-drill-down-lucenenet/ This article does
So, Im following this great tutorial at http://www.raywenderlich.com/5191/beginning-storyboards-in-ios-5-part-2 to get started with iOS programming.
I have just found this great tutorial as it is something that I need.
I'm using the popular restful authentication app/tutorial found here: http://railsforum.com/viewtopic.php?pid=74245#p74245 I have been using
I have found this great tutorial, about uploading files with a Flex app, using
I have found this tutorial , which looks great, except the fact, that I
I found this tutorial: http://stream0.org/2008/02/howto-extract-images-from-a-vi.html Where it tells me how to extract frames from
I found this great tutorial on how to use JSON to retrieve Twitter updates,
I am trying to implement reset password functionality using the tutorial at http://www.binarylogic.com/2008/11/16/tutorial-reset-passwords-with-authlogic/ and
I want to create an FAQ page like the one on this website http://www.microsoft.com/windows/windows-7/faq.aspx

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.