I am having trouble generating a Google map, with markers. Several
days of trying to debug my code and checking the web has not yielded a
solution. I hope some other eyes will be able to put me on the right
track.

I am following the suggestions here:
http://c:ode.google.com/apis/maps/articles/phpsqlajax_v3.html

I created all the test files in the link above and they worked on my
server as they should.

I need to modify the example code to produce my application.
I am getting data from a MySql database, which produces XML with the
variables: name, lat, lng and freq. The XML is produced. However, the
code that should display the map and two different markers, depending
on the value of “freq” does not work. Neither the map nor the markers
are shown.

Here is the link to the URL that produces the data in XML format.
http://hspa.com/map/phpsqlajax_genxml3a.php

Depending on your browser, you may have use View/Source to see the
data.

Here are the edits I made to the file that should generate the map.
The original file is:
http://gmaps-samples-v3.googlecode.com/svn/trunk/articles/phpsqlajax/phpsqlajax_map_v3.html

My URL is here:
http://hspa.com/map/newspapermap.html

My edits to 
http://gmaps-samples-v3.googlecode.com/svn/trunk/articles/phpsqlajax/phpsqlajax_map_v3.html
Were (my notes refer to line numbers in http://hspa.com/map/newspapermap.html):

Lines 10-19 define the custom markers and now read:
    var customIcons = {
      Daily: {
        icon: 'http://labs.google.com/ridefinder/images/
mm_20_blue.png',
        shadow: 'http://labs.google.com/ridefinder/images/
mm_20_shadow.png'
      },
      Nondaily: {
        icon: 'http://labs.google.com/ridefinder/images/
mm_20_red.png',
        shadow: 'http://labs.google.com/ridefinder/images/
mm_20_shadow.png'
      }
    };

“Daily” and “Nondaily” are values of the “freq” variable in the XML.

Line 23 was edited to center the map on Indianapolis, Ind.:
center: new google.maps.LatLng(39.766609, -86.156816),

Line 30 was edited to point to my file that generates the XML, which
works.
 downloadUrl("phpsqlajax_genxml3a.php", function(data) {

I removed the var definition for “address” since there is no address
in my XML.

In line 36, I changed “type” to “freq.”
         var freq = markers[i].getAttribute("freq");

In line 42, I edited the html variable to remove address and leave
name.
  var html = "<b>" + name + "</b>;

In line 43, I substituted “freq” for “type.”
var icon = customIcons[freq] || {};

In line 87, I edited the size of the map.
   <div id="map" style="width: 800px; height: 1000px"></div>

I would deeply appreciate any suggestions about how to get this
working.


-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to