Thanks a billion, I expanded upon it and updated some of my database entries and it looks very very nice! http://www.undergroundrp.com/dev3/map2.html
Now I am just on the "pretty-it-up" phase, would anyone know how I could change the gray background to a color more like the water (#405357) so that it would look continuous? The outer tiles them selfs I can fix in a image editing program, but the actual API background I do not know how to change, I have searched around a little and can only find text changes from what i understand and not the actual API bg. Thanks for all the help! On 10 Jun, 22:22, "[email protected]" <[email protected]> wrote: > On Jun 10, 12:48 pm, Tinman <[email protected]> wrote: > > > I have attempted to create a way to toggle by types, but it seems the > > method used in thehttp://econym.org.uk/gmap/categories.htm > > tutorial is not working in v3 or I am just not able to get it to work, > > the later being very possible ;) > > I have put up a new map page as I do not want to ruin the other one as > > it is working very good right now, the new example map with the > > attempted type (category) toggling can be found > > here:http://www.undergroundrp.com/dev3/map2.html > > > I have probably messed up a whole lot of things in that one, but I am > > thinking positive as long as the map and icons load at all :p > > > If anyone has any clue on how to do this, please reply it would be > > very appreciated! > > You are close. > Problems: > 1. boxclick is local to your initialize function (as are some of your > other functions), the html click handlers execute in the global scope. > 2. APIv3 has a different show/hide syntax, it uses the setVisible > method. > 3. you need to add the global gmarkers array to your code > > http://www.geocodezip.com/undergroundrp_com_map2b.html > > -- Larry > > > > > > > On 10 Jun, 19:41, Tinman <[email protected]> wrote: > > > > ooh, now that is useful, having info boxes like that could help out > > > giving a better description of certain things. > > > I will look into the tutorial you linked, it might work. If I get > > > something I will post my results here ;) > > > > On 10 Jun, 18:35, "[email protected]" <[email protected]> wrote: > > > > > On Jun 10, 9:11 am, Tinman <[email protected]> wrote: > > > > > > I actually figured that out and got separate icons loading for my > > > > > markers, though the shadows seems to be a bit to the left of where > > > > > they should be located but that is something I could fix in a image > > > > > editing program. > > > > > If you do want > > > > infowindows:http://www.geocodezip.com/undergroundrp_com_mapC.html > > > > > I haven't looked at marker categories with v3, but Mike Williams' > > > > tutorial:http://econym.org.uk/gmap/ > > > > > has an example for v2 that should be able to be used for the > > > > concepts.http://econym.org.uk/gmap/categories.htm > > > > > -- Larry > > > > > > Now onto my next step, being able to toggle markers depending on what > > > > > type they are, if there are anyone in here that knows how just shout > > > > > it out, I will be looking into it myself now, I just hope its not as > > > > > complicated as the past few things I have been doing ;) > > > > > > Thanks again to everyone, you have really helped me out a whole lot, I > > > > > really appreciate it! > > > > > > On 10 Jun, 18:05, Tinman <[email protected]> wrote: > > > > > > > Thanks, removing that completely out of the code made the icons > > > > > > appear, right now only the shadow as thats the only thing that I > > > > > > knew > > > > > > would work, now I just need to figure out how to load the actual > > > > > > icon > > > > > > that I want for each marker onto it. > > > > > > > On 10 Jun, 18:00, "[email protected]" <[email protected]> > > > > > > wrote: > > > > > > > > On Jun 10, 8:04 am, Tinman <[email protected]> wrote: > > > > > > > > > Thanks again for your help, I really appreciate it. > > > > > > > > > But even after adding this the markers still fail to show up on > > > > > > > > the > > > > > > > > map, I have looked over my code several times also now and I > > > > > > > > think > > > > > > > > everything is defined, and everything seems right, though I am > > > > > > > > not > > > > > > > > very good with the API and Java so its not that easy for me to > > > > > > > > spot if > > > > > > > > anything is actually wrong. (I am more of a php sql guy) > > > > > > > > > I hope we can figure this thing out, the people in the > > > > > > > > community I am > > > > > > > > in, and myself would love it ;) > > > > > > > > Thanks one more time for all the help I am getting! > > > > > > > > I get a straight javascript error: > > > > > > > Line: 48 > > > > > > > Error: 'description' is undefined > > > > > > > > Because "description" is undefined in this line: > > > > > > > var html = "<b>" + name + "</b> <br/>" + description; > > > > > > > > Then: > > > > > > > Line: 56 > > > > > > > Error: 'infoWindow' is undefined > > > > > > > > Because that isn't defined either. > > > > > > > > -- Larry > > > > > > > > > On 10 Jun, 16:43, Scorpius <[email protected]> wrote: > > > > > > > > > > Seems you're still missing one more function. > > > > > > > > > > function parseXml( str ) > > > > > > > > > { > > > > > > > > > if (window.ActiveXObject) > > > > > > > > > { > > > > > > > > > var doc = new > > > > > > > > > ActiveXObject('Microsoft.XMLDOM'); > > > > > > > > > doc.loadXML(str); > > > > > > > > > return doc; > > > > > > > > > } > > > > > > > > > else if (window.DOMParser) > > > > > > > > > { > > > > > > > > > return (new DOMParser).parseFromString(str, > > > > > > > > > 'text/xml'); > > > > > > > > > } > > > > > > > > > > } > > > > > > > > > > On Jun 10, 10:20 am, Tinman <[email protected]> wrote: > > > > > > > > > > > Thanks, I got that added now, but still no markers are > > > > > > > > > > showing up on > > > > > > > > > > the map, I though they might have been invisible but they > > > > > > > > > > are not > > > > > > > > > > there at all. > > > > > > > > > > > On 10 Jun, 16:02, Scorpius <[email protected]> wrote: > > > > > > > > > > > > Looks like you still haven't defined the function > > > > > > > > > > > doNothing yet. > > > > > > > > > > > Just use: > > > > > > > > > > > function doNothing() {} > > > > > > > > > > > > On Jun 10, 9:06 am, Tinman <[email protected]> wrote: > > > > > > > > > > > > > Thanks for your reply. > > > > > > > > > > > > I tried to define it with this code: > > > > > > > > > > > > > function downloadUrl(url,callback) { > > > > > > > > > > > > var request = window.ActiveXObject ? > > > > > > > > > > > > new ActiveXObject('Microsoft.XMLHTTP') : > > > > > > > > > > > > new XMLHttpRequest; > > > > > > > > > > > > > request.onreadystatechange = function() { > > > > > > > > > > > > if (request.readyState == 4) { > > > > > > > > > > > > request.onreadystatechange = doNothing; > > > > > > > > > > > > callback(request.responseText, request.status); > > > > > > > > > > > > } > > > > > > > > > > > > }; > > > > > > > > > > > > > request.open('GET', url, true); > > > > > > > > > > > > request.send(null); > > > > > > > > > > > > > } > > > > > > > > > > > > > And now the map loads again, but it does not load any > > > > > > > > > > > > markers. > > > > > > > > > > > > Is there something wrong in the first piece of code > > > > > > > > > > > > maybe? > > > > > > > > > > > > > Thanks again for your reply, getting the downloadUrl > > > > > > > > > > > > defined seems to > > > > > > > > > > > > have been part of the answer. > > > > > > > > > > > > > On 10 Jun, 10:15, Davide Cremonesi <[email protected]> > > > > > > > > > > > > wrote: > > > > > > > > > > > > > > downloadUrl is not defined. > > > > > > > > > > > > > google.maps.DownloadUrl or GDownloadUrl are part of > > > > > > > > > > > > > the v2 API. > > > > > > > > > > > > > Now v3 is loaded by default, so if you want to use v2 > > > > > > > > > > > > > APIs you have to > > > > > > > > > > > > > load it explicitly specifying the v=2 in the google > > > > > > > > > > > > > maps api URL. > > > > > > > > > > > > > > Ciao, > > > > > > > > > > > > > Davide > > > > > > > > > > > > > > On Jun 10, 8:53 am, Tinman <[email protected]> wrote: > > > > > > > > > > > > > > > Hi. > > > > > > > > > > > > > > I have been working on a dynamic map for a game > > > > > > > > > > > > > > lately and I am trying > > > > > > > > > > > > > > to add markers from database entries. > > > > > > > > > > > > > > I have mad the database and added a few entries > > > > > > > > > > > > > > into it, I have also > > > > > > > > > > > > > > made a .php file that creates a xml file that the > > > > > > > > > > > > > > Google Maps API > > > > > > > > > > > > > > should be able to collect information from that to > > > > > > > > > > > > > > add markers onto my > > > > > > > > > > > > > > map. > > > > > > > > > > > > > > > The map is located > > > > > > > > > > > > > > here:http://www.undergroundrp.com/dev3/map.html > > > > > > > > > > > > > > The .php file that creates the .xml file is > > > > > > > > > > > > > > here:http://www.undergroundrp.com/dev3/phpsqlajax_genxml.php > > > > > > > > > > > > > > > The code I am currently using to attempt to collect > > > > > > > > > > > > > > the xml > > > > > > > > > > > > > > information and put it onto the map: > > > > > > > > > > > > > > > <!--Add Markers From Database Start--> > > > > > > > > > > > > > > > downloadUrl("phpsqlajax_genxml.php", function(data) > > > > > > > > > > > > > > { > > > > > > > > > > > > > > var xml = parseXml(data); > > > > > > > > > > > > > > var markers = > > > > > > > > > > > > > > xml.documentElement.getElementsByTagName("marker"); > > > > > > > > > > > > > > for (var i = 0; i < markers.length; i++) { > > > > > > > > > > > > > > var name = markers[i].getAttribute("name"); > > > > > > > > > > > > > > var description = > > > > > > > > > > > > > > markers[i].getAttribute("description"); > > > > > > > > > > > > > > var image = markers[i].getAttribute("icon"); > > > > > > > > > > > > > > var point = new google.maps.LatLng( > > > > > > > > > > > > > > parseFloat(markers[i].getAttribute("lat")), > > > > > > > > > > > > > > parseFloat(markers[i].getAttribute("lng"))); > > > > > > > > > > > > > > var html = "<b>" + name + "</b> <br/>" + > > > > > > > > > > > > > > description; > > > > > > > > > > > > > > var image = > > > > > > > > > > > > > > 'http://google-maps-icons.googlecode.com/files/'+icon; > > > > > > > > > > > > > > var marker = new google.maps.Marker({ > > > > > > > > > > > > > > map: map, > > > > > > > > > > > > > > position: point, > > > > > > > > > > > > > > icon: image, > > > > > > > > > > > > > > shadow: > > > > > > > > > > > > > > 'http://google-maps-icons.googlecode.com/files/ > > > > > > > > > > > > > > shadow.png' > > > > > > > > > > > > > > }); > > > > > > > > > > > > > > bindInfoWindow(marker, map, infoWindow, html); > > > > > > > > > > > > > > } > > > > > > > > > > > > > > > }); > > > > > > > > > > > > > > > <!--Add Markers From Database End--> > > > > > > > > > > > > > > > But this "destroys" my map, and I have no idea how > > > > > > > > > > > > > > to do this, I have > > > > > > > > > > > > > > no > > ... > > les mer » -- 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.
