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

  • Home
  • SEARCH
  • 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 7966613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:28:32+00:00 2026-06-04T06:28:32+00:00

I am trying to create a google map with custom icon markers. I need

  • 0

I am trying to create a google map with custom icon markers. I need to be able to add dynamic text to the actual marker. In other words is there anyway to add a div? I need to add prices from xml to the actual marker.. I hope this makes sense. ANY HELP would be greatly appreciated or if anyone can point me in the right direction. Thanks!

MY JQUERY:

function addMarker() {
    for (var i = 0; i < markers.length; i++) {
        // obtain the attribues of each marker
        var lat = parseFloat(markers[i][0]);
        var lng = parseFloat(markers[i][1]);
        var trailhead_name = markers[i][2];

        var myLatlng = new google.maps.LatLng(lat, lng);

        var contentString = "<html><body><div class='mapPopup'><div class='mapPopIn'>" + trailhead_name + "</div></div></body></html>";
        var image = 'images/map-marker.png';
        var marker = new google.maps.Marker({
            position: myLatlng,
            map: map,
            title: "Click for more information",
            icon: image
        });

The actual map i am trying to modify is: http://travellinginmexico.com/hotels_map.php?c=cancun

  • 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-06-04T06:28:33+00:00Added an answer on June 4, 2026 at 6:28 am

    There are two options, InfoBox and MarkerWithLabel. I like MarkerWithlabel because it’s lighter and easier to use. The disadvantage is I can’t figure out how to replace the text of Markerwithlabel after it’s created. You can do so with InfoBox because you actually need to create a div.

    I’ll give an example with static data from the Javascript which you can replace with data from an XML. You will also need to style the MarkerWithLabel to fit your icon. For example, labelStyle: top will change the vertical offset.

    http://jsfiddle.net/RAH6G/ click the “not really ajax” button.

     function createMarker(position, label) {
       return new MarkerWithLabel({
       position: position,
       draggable: false,
       map: map,
       labelText: label,
       labelClass: "labels", // the CSS class for the label
       labelStyle: {top: "0px", left: "-21px", opacity: 0.75},
       labelVisible: true
       });
     }
    
     var readData = function() { // create markers
      pos = [
      new google.maps.LatLng(40, -85),
      new google.maps.LatLng(42, -92),
      new google.maps.LatLng(36, -100),
      new google.maps.LatLng(39, -112)
      ];
    
      label = ["$200", "99pts.", "US$30", "US$999"];
      for (var i = 0; i < pos.length; i++) {
        createMarker(pos[i], label[i]);
      }     
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a custom javascript class that inherits from google.maps.Map (V3 API).
I'm trying to create dynamic markers using google maps api and am having problems
I'm trying to add markers to a map on my page using Google's Javascript
I'm trying to create a Google Map with multiple markers on it, that loads
I am trying to create a Google Map with a single coordinate as marker.
I am trying to create a custom google map using Longitudes and Latitudes that
I have been trying to create a new google custom search engine, but when
I am trying to create a Google Map where the user can plot the
I'm trying to center a google map on a single marker pulled from a
I'm trying to make a Google map that updates a marker as a user's

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.