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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T07:19:58+00:00 2026-05-18T07:19:58+00:00

heres the problem, i have a database thats hold information on marker images: i’m

  • 0

heres the problem, i have a database thats hold information on marker images:

i’m retreiving all that with an ajax call and saving the data as objects, so i can check the location type of the marker and place the appropriate marker for that type of location.

am reciving the data fine but when i try to add the data into the contructor for a new google map image it errors, i have checked with an alert that the right information is there and it is so what gives???

// the following code will wor!!!
                   new google.maps.Size(32,37) // The Size works
//The following line breaks it with dynamic value    
                   new google.maps.Size(myIconArray.icon[myData.name_etp].size) 

heres the full code:
(the test values in the static lines of code are the same values that are stored in the object references i am making)
http://www.focus-on-plants.com/locator_iconed.php

function addMarker(map, myData){
      console.log(myData)
      // Create the marker
      // create the marker info first
      myLatLng = new google.maps.LatLng(myData.lat_mdt, myData.lng_mdt);
      markersArray.push(myLatLng);
      markersInfoArray.push(myData);

      // ----------------------------
      // NOW CREATE THE ACTUAL ICON
       //alert( myIconArray.icon[myData.name_etp].size)

      /*var iconimage = new google.maps.MarkerImage(
       '/images/icons/markers/flower_lb/image_med.png', //myIconArray.icon[myData.name_etp].image,
       new google.maps.Size(myIconArray.icon[myData.name_etp].size) // The Size
       //new google.maps.Point(myIconArray.icon[myData.name_etp].origin), // The origin
       //new google.maps.Point(myIconArray.icon[myData.name_etp].anchorpoint) // The anchor
      );*/
      //console.log(iconimage)
      var iconshape = {
       type: 'poly',
       coord: [0,2,1,2,1,1,18,0,18,1,19,2,20,19,19,19,18,21,14,21,10,26,5,21,1,21,1,20,0,20,0,2]
      }

      //alert(myIconArray.shape[myData.name_etp])
      mySize = 'new google.maps.Size('+myIconArray.icon[myData.name_etp].size+')'
      var iconimage = new google.maps.MarkerImage(
       myIconArray.icon[myData.name_etp].image,
       // the following code works!!!
                        new google.maps.Size(32,37) // The Size works
                       //The following line breaks iot with dynamic value    
                       //new google.maps.Size(myIconArray.icon[myData.name_etp].size) 


       //new google.maps.Point(0, 0), // The origin
       //new google.maps.Point(13,29) // The anchor
      );
      var iconshadow = new google.maps.MarkerImage(
       '/images/icons/markers/flower_lb/shadow_med.png',
       new google.maps.Size(42,18), // The Size
       new google.maps.Point(0,0), // The origin
       new google.maps.Point(13,18) // The anchor
      );

      var marker = new google.maps.Marker({
       position: myLatLng,
       map: map,
       title: myData.name_mdt,
       icon: iconimage,
       shadow: iconshadow//,
       //shape: iconshape
      });

      // Wrapping the event listener inside an anonymous function
      // that we immediately invoke and passes the variable i to.
      (function(myData, marker) {
       // Creating the event listener. It now has access to the values of
       // myData and marker as they were during its creation
       google.maps.event.addListener(marker, 'click', function() {
        //create thecontent for the infowindow
        var content = createContent(myData);
        var infowindow = new google.maps.InfoWindow({
         content: content
        });
        infowindow.open(map, marker);
       });
      })(myData, marker);  

     };
  • 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-18T07:19:58+00:00Added an answer on May 18, 2026 at 7:19 am

    ok so i found out why this was,

    i was passing new google.maps.Size(myIconArray.icon[myData.name_etp].size)

    google image maps.size takes two seperate parameters, new google.maps.Size(42,18)

    i was passing 32, 37 which was actualy a string,

    i needed to split the string up using the following:

    tmp = myIconArray.icon[myData.name_etp].size.split(",")

    then to add the x and y for the size i use: new google.maps.Size(tmp[0], tmp[1])

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's my problem: I have a virtual method defined in a .h file that
Here's my problem: I have to call a web service with a secure header
Here's the problem: 1.) We have page here... www.blah.com/mypage.html 2.) That page requests a
Here is the problem: We have all of our development under subversion, but our
I have a table in my database that represents datafields in a custom form.
I have an NSObject that I am using to store/hold properties of an object,
Ok I have a database that looks as follows: Orders, Services, OrderUnits, Notes Orders:
I have a database that has two fields: current, and previous. Here is the
I have a listings database. I also have a listings_attributes database that looks like
I have legacy database and tables that I would like to try to import

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.