Search Results

Search found 413 results on 17 pages for 'markers'.

Page 1/17 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • plot markers on google maps with json and jquery

    - by mark
    I am trying to plot the markers as defined in a json file om Google Maps but they don't show on the map. Can somebody help me with this problem? This is the Json file: http://sionvalais.com/gmap/markers/ This is the Javascritp function: function loadMarkers() { var bounds = map.getBounds(); var zoomLevel = map.getZoom(); $.post("/gmaps/markers/index.php", {zoom: zoomLevel, swLat: bounds.getSouthWest().lat(), swLon: bounds.getSouthWest().lng(), neLat: bounds.getNorthEast().lat(), neLon: bounds.getNorthEast().lng()}, function(data) { processMarkers(data, _smallMarkerSize); }, "json" ); } function processMarkers(webcams, markerSize) { var marker = null; var markersInView = new Array(); var idsInView = new Array(); // Loop through the new webcams for (var i = 0; i < webcams.length; i++) { var idx = markers.indexOf(webcams[i].id); if (idx == -1) { var info_html = "<table class='infowindow'>"; info_html += "<tr><td class='img'>"; info_html += "<img src='" + webcams[i].smallimg + "' /><td>"; info_html += "<td><p><b>" + webcams[i].loc + "</b>"; info_html += "<br /><a href='/webcam/" + webcams[i].url + "' target='_blank'>Show webcam</a></p></td></tr>"; info_html += "</table>"; marker = new WebcamMarker(new GLatLng(webcams[i].latitude, webcams[i].longitude), {image: "" + webcams[i].smallimg + "", height: markerSize, width: markerSize}); marker.myhtml = info_html; map.addOverlay(marker); markersInView[webcams[i].id] = marker; } else { markersInView[webcams[i].id] = markers[webcams[i].id]; } idsInView.push(webcams[i].id); } // Now remove the markers outside of the viewport for (var i = 0; i < webcamids.length; i++) { var idx = markersInView.indexOf(webcamids[i]); if (idx == -1) { marker = markers[webcamids[i]]; map.removeOverlay(marker); } } markers = markersInView; webcamids = idsInView; }

    Read the article

  • Removing Directions markers from the Google Maps API V3

    - by anonymous
    To remove a normal marker from a map, I understand you simply call marker.setMap(null), but when implementing the Google Maps directions services, it automatically adds markers A and B onto the map ( calculating directions from point A to point B ). I do not have control over these markers, so I cannot remove them in the normal way. So how can I remove these markers (I have custom markers on the map instead)?

    Read the article

  • Show count of all google map markers

    - by aland
    Is there any easy way using the api to get a count of all markers on a map? I have a page similar to this http://www.gorissen.info/Pierre/maps/googleMapLocationv3.php where a user can add markers by clicking on the map. I'd also like to show a count of all the markers. I could do this by declaring a global count var and incrementing it in the event listener, but I thought it would be better if there was an API method I could use and I can find it in the docs.

    Read the article

  • How to get all visible markers on current zoom level

    - by nefo_x
    Here are some points: 1) I have some markers on the map and records associated with it on the right panel besides the map. They are connected via numeric id, which is stored as a property of marker. 2) All the markers are stored in an array. 3) When the user zooms in the map, records, associated to only visible markers should be shown on the right panel. So, how to get the list of all visible markers on the current zoom level? I've searched over the internet and didn't find something useful. Some kind of what I'm trying to achieve could be found here

    Read the article

  • How to change Gmap markers color?

    - by user191687
    Hi! I've a custom google map with different points: Markers[0] = new Array(new GMarker(new GLatLng(45.0, 9.0)), "Location1", "<strong>Address Line</strong><br/>Some information"); Markers[1] = new Array(new GMarker(new GLatLng(45.0, 12.0)), "Location2", "<strong>Address Line</strong><br/>Some information"); etc. Simply I want to change the color of the markers from the default red. I.E. the 2nd blue. How to do this?

    Read the article

  • Removing google mail markers with jquery after getting them from xml

    - by sebastian
    Hi there, I'm trying to create a page that contains a google map. The map is filled with markers from an xml file. I just can't figure out how to remove "old" markers, that don't match the latest user input. At the moment my js stops after the very first xml item. The clearList.push(marker); is supposed to put the generated marker away for later usage. When the user hits the search button I want all markers to be gone and use clearMarkers();. Maybe someone here can help Sebastian Here is my JavaScript: $(document).ready(function() { $("#map").css({height: 650}); var clearList = []; var myLatLng = new google.maps.LatLng(52.518143, 13.372879); MYMAP.init('#map', myLatLng, 11); $("#showmarkers").click(function(e){ clearMarkers(); MYMAP.placeMarkers('markers.xml'); }); }); function clearMarkers() { $(clearList).each(function () { this.setmap(null); }); clearList = []; } var MYMAP = { map: null, bounds: null } MYMAP.init = function(selector, latLng, zoom) { var myOptions = { zoom:zoom, center: latLng, mapTypeId: google.maps.MapTypeId.HYBRID } this.map = new google.maps.Map($(selector)[0], myOptions); this.bounds = new google.maps.LatLngBounds(); } MYMAP.placeMarkers = function(filename) { $.get(filename, function(xml){ $(xml).find("marker").each(function(){ // read values from xml for searching var platzart = $(this).find('platzart').text(); var ort = $(this).find('ort').text(); var open = $(this).find('open').text(); if (platzart =="Kunstrasen" && $('#kunstrasen').attr('checked') || platzart =="Rasen" && $('#rasen').attr('checked') || platzart =="Tartan" && $('#tartan').attr('checked') || platzart =="Boltzplatz" && $('#boltzplatz').attr('checked') ){ // read values from xml for additional info var name = $(this).find('name').text(); var plz = $(this).find('plz').text(); var note = $(this).find('note').text(); var adress = $(this).find('adress').text(); // create a new LatLng point for the marker var lat = $(this).find('lat').text(); var lng = $(this).find('lng').text(); var point = new google.maps.LatLng(parseFloat(lat),parseFloat(lng)); // extend the bounds to include the new point MYMAP.bounds.extend(point); // create new marker var marker = new google.maps.Marker({ position: point, map: MYMAP.map }); clearList.push(marker); // add onclick overlay var infoWindow = new google.maps.InfoWindow(); var html='<strong>'+name+'</strong.><br />'+platzart; google.maps.event.addListener(marker, 'click', function() { infoWindow.setContent(html); infoWindow.open(MYMAP.map, marker); }); } MYMAP.map.fitBounds(MYMAP.bounds); }); }); } Thanks in advance

    Read the article

  • Generating Google Maps markers using Ruby

    - by ischnura
    I would like to do a very simple task: add some markers in a Google Map using a list of addresses from an array. I have been thinking about generating the Google Maps JavaScript API code using ruby (printf) but this does not seem like a very clean and beautiful solution... I have read about YM4R for Ruby on Rails... my project is pretty simple and I have never worked with Ruby on Rails... I have also never used JQuerry... but I am very willing to learn to use this tools :) What do you think will be the best approach to generating the markers?

    Read the article

  • Creating multiple markers in Google Maps using XML

    - by Jessica Stanley
    I'm almost sure this question has been asked before, but for the love of me I just can't find the answer anywhere. Basically what I want to do is create multiple markers on a custom Google Map I'm building. I already have an XML file with the coordinates (lat/lng) and title of each item. I'd like to take the data from the XML file and use it to create markers on the map. I've found how to do this using KML files and MySQL/PHP, but I need to know how to do it in Javascript. One more thing: I have a .xml file of my own, so it won't be like I'll be getting the data from a webpage because I believe (from research I've done today) that the code for that may be different. If anyone knows if this has been posted somewhere else before, could you please direct me there? I've literally been searching all day, this is my last resort. Thanks a ton!!!

    Read the article

  • using multi-markers with multi info-windows

    - by mohsen
    I have an array of info-windows corresponding to an array of markers. Now, I have a problem, I use the below code to generate an info-window, when clicking on the marker all the markers disappear unless one, also when I click on that marker there is no info-window come out. What is the wrong with my code ? or what shall I do ? Any answer will be very appreciated, Thanks in advance. This code is inside a for loop: infoWindoArray[i][j] = new google.maps.InfoWindow({ content:"Lat: "+this.position.lat() + "\nLng: " + this.position.lng() + "\n"+ this.customInfo, }); google.maps.event.addListener(AllMarkers[i][j], 'click', (function(x) { return function() {infoWindoArray[i][j].open(map,AllMarkers[i][j]);} })(x));

    Read the article

  • Toggling on/off Markers in Google Maps API v3

    - by Douglas
    I'm having trouble getting the setMap(null); function that everyone seems to be recommending to work. I believe it may be a problem with the way I've implemented the markers. If someone could take a look and let me know if you see something wrong I'd greatly appreciate it. LINK: http://www.dougglover.com/samples/UOITMap/v2/

    Read the article

  • Markers in Google Maps Application

    - by Samuh
    I am supposed to display a certain location using Google Maps application. I have lat/long values and tried Intent.ACTION_VIEW with "geo:lat,long?z=15" uri. The Google Maps application loads centered on the supplied lat-long value but obviously does not display any marker(overlays) pin-pointing the location. Is it possible to request the Google Maps App to display markers? Also, the zoom level paramater doesnt seem to work. Maps load at the default zoom level of 10. I can easily achieve this using MapActivity but Google Map App is what is desired. Thanks

    Read the article

  • different markers on google maps v3

    - by user1447313
    i need help again :( How i can add different markers to google map v3. here is example for may marker var latlng = new google.maps.LatLng(lat,lng); var image = "../img/hotel_icon.png"; var locationDescription = this.locationDescription; var marker = new google.maps.Marker({ map: map, position: latlng, title:'pk:'+name, icon: image }); bounds.extend(latlng); setMarkes(map, marker, name, locationDescription); });//close each map.fitBounds(bounds); });//close getjson }//close initialize function setMarkes(map, marker, name, locationDescription){ google.maps.event.addListener(marker, 'mouseover', function() { infowindow.close(); infowindow.setContent('<h3>'+name+'</h3><em>'+locationDescription+'</em>'); infowindow.open(map, marker); }); } is any help

    Read the article

  • Websql to google maps markers

    - by Roy van Neden
    I am busy with my web application for a school project. It has has two pages. The first page uploads the location(latitude and longitude), price, date and kind of fuel. It works and i saved it with websql.(see screenshot) Now i want to get everything out of the web database and put it as a marker on my google maps card. I have my own location already. But i dont know how to get everything from the database to the map as a marker. I'm using jquery mobile/html5/css/javascript only. Code to put it in a array or something else that will work. db.transaction(function(tx){ tx.executeSql('SELECT brandstofsoort, literprijs, datum, latitude, longitude FROM brandstofstatus', [], function (tx, results) { var lengte = results.rows.length, i; for(var i = 0; i< lengte; i++){ var locations = [ [ ], [ ], [ ], [ ], [ ] ]; } // / for loop });// /tx.executeSql });// /db.transaction Thanks in advance!

    Read the article

  • Problem with large number of markers on the map...

    - by bobetko
    I am working on an Android app that already exists on iPhone. In the app, there is a Map activity that has (I counted) around 800 markers in four groups marked by drawable in four different colors. Each group can be turned on or off. Information about markers I have inside List. I create a mapOverlay for each group, then I attach that overlay to the map. I strongly believe that coding part I did properly. But I will attach my code anyway... The thing is, my Nexus One can't handle map with all those markers. It takes around 15 seconds just to draw 500 markers. Then when all drawn, map is not quite smooth. It is sort of hard to zoom and navigate around. It can be done, but experience is bad and I would like to see if something can be done there. iPhone seems doesn't have problems showing all these markers. It takes roughly about 1-2 seconds to show all of them and zooming and panning is not that bad. Slow down is noticeable but still acceptable. I personally think it is no good to draw all those markers, but app is designed by somebody else and I am not supposed to make any drastic changes. I am not sure what to do here. It seems I will have to come up with different functionality, maybe use GPS location, if known, and draw only markers within some radius, or, if location not known, use center of the screen(map) and draw markers around that. I will have to have reasonable explanation for my bosses in case I make these changes. I appreciate if anybody has any idas. And the code: ... for (int m = 0; m < ArrList.size(); m++) { tName = ArrList.get(m).get("name").toString(); tId = ArrList.get(m).get("id").toString(); tLat = ArrList.get(m).get("lat").toString();; tLng = ArrList.get(m).get("lng").toString();; try { lat = Double.parseDouble(tLat); lng = Double.parseDouble(tLng); p1 = new GeoPoint( (int) (lat * 1E6), (int) (lng * 1E6)); OverlayItem overlayitem = new OverlayItem(p1, tName, tId); itemizedoverlay.addOverlay(overlayitem); } catch (NumberFormatException e) { Log.d(TAG, "NumberFormatException" + e); } } mapOverlays.add(itemizedoverlay); mapView.postInvalidate(); ................................ public class HelloItemizedOverlay extends ItemizedOverlay<OverlayItem> { private ArrayList<OverlayItem> mOverlays = new ArrayList<OverlayItem>(); private Context mContext; public HelloItemizedOverlay(Drawable defaultMarker, Context context) { super(boundCenterBottom(defaultMarker)); mContext = context; } public void addOverlay(OverlayItem overlay) { mOverlays.add(overlay); populate(); } @Override protected OverlayItem createItem(int i) { return mOverlays.get(i); } @Override public int size() { return mOverlays.size(); } @Override protected boolean onTap(int index) { final OverlayItem item = mOverlays.get(index); ... EACH MARKER WILL HAVE ONCLICK EVENT THAT WILL PRODUCE CLICABLE ... BALOON WITH MARKER'S NAME. return true; } }

    Read the article

  • Delete old map markers and load new ones?

    - by pufAmuf
    I'm trying to delete the old markers and load new ones. Here is the code I have that loads certain markers on page load - no issues here: (function() { var customIcons = { 1: { icon: 'redmarker.png', shadow: 'markershadow.png' }, 2: { icon: 'purplemarker.png', shadow: 'markershadow.png' }, 3: { icon: 'silvermarker.png', shadow: 'markershadow.png' }, 4: { icon: 'goldmarker.png', shadow: 'markershadow.png' } }; window.onload = function(){ var MY_MAPTYPE_ID = 'custom'; var stylez = [ { "stylers": [ { "hue": "#00ccff" }, { "saturation": -100 }, { "lightness": 5 } ] },{ } ]; var latlng = new google.maps.LatLng(10, 10); var options = { zoom: 16, center: latlng, panControl: false, zoomControl: false, scaleControl: true, mapTypeControlOptions: { mapTypeIds: [MY_MAPTYPE_ID,google.maps.MapTypeId.SATELLITE] }, mapTypeId: MY_MAPTYPE_ID }; var map = new google.maps.Map(document.getElementById('map'), options); var styledMapOptions = { name: 'Map' }; var jayzMapType = new google.maps.StyledMapType(stylez, styledMapOptions); map.mapTypes.set(MY_MAPTYPE_ID, jayzMapType); var infoWindow = new google.maps.InfoWindow; // Change this depending on the name of your PHP file downloadUrl("getxml.php", function(data) { var xml = data.responseXML; var markers = xml.documentElement.getElementsByTagName("marker"); for (var i = 0; i < markers.length; i++) { var name = markers[i].getAttribute("id"); var address = markers[i].getAttribute("id"); var type = markers[i].getAttribute("venue_type"); var point = new google.maps.LatLng( parseFloat(markers[i].getAttribute("lat")), parseFloat(markers[i].getAttribute("lng"))); var html = "<b>" + name + "</b> <br/>" + address; var icon = customIcons[type] || {}; var marker = new google.maps.Marker({ map: map, position: point, icon: icon.icon, shadow: icon.shadow }); bindInfoWindow(marker, map, infoWindow, html); } }); //BUTTON SWITCHING //////////////////////////////////////////////////////////// //BUTTON SWITCHING //////////////////////////////////////////////////////////// //BUTTON SWITCHING //////////////////////////////////////////////////////////// //BUTTON SWITCHING //////////////////////////////////////////////////////////// //BUTTON SWITCHING //////////////////////////////////////////////////////////// //BUTTON SWITCHING //////////////////////////////////////////////////////////// //BUTTON SWITCHING //////////////////////////////////////////////////////////// jQuery(document).delegate(".topCanBeActive", "click", function( e ) { e.preventDefault(); jQuery(".topCanBeActive").removeClass("topActive"); jQuery(this).addClass("topActive"); switch( this.id ){ case 'all_activity_button': alert("search"); break; case 'events_button': downloadUrl("getxml2.php", function(data) { var xml = data.responseXML; var markers = xml.documentElement.getElementsByTagName("marker"); for (var i = 0; i < markers.length; i++) { var name = markers[i].getAttribute("id"); var address = markers[i].getAttribute("id"); var type = markers[i].getAttribute("venue_type"); var point = new google.maps.LatLng( parseFloat(markers[i].getAttribute("lat")), parseFloat(markers[i].getAttribute("lng"))); var html = "<b>" + name + "</b> <br/>" + address; var icon = customIcons[type] || {}; var marker = new google.maps.Marker({ map: map, position: point, icon: icon.icon, shadow: icon.shadow }); bindInfoWindow(marker, map, infoWindow, html); } }); break; case 'venues_button': alert("venues"); break; case 'search_button': alert("search"); break; } }); //END //////////////////////////////////////////////////////////// //END //////////////////////////////////////////////////////////// //END //////////////////////////////////////////////////////////// //END //////////////////////////////////////////////////////////// //END //////////////////////////////////////////////////////////// //END //////////////////////////////////////////////////////////// //END //////////////////////////////////////////////////////////// //END //////////////////////////////////////////////////////////// } function bindInfoWindow(marker, map, infoWindow, html) { google.maps.event.addListener(marker, 'click', function() { infoWindow.setContent(html); infoWindow.open(map, marker); }); } 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, request.status); } }; request.open('GET', url, true); request.send(null); } function doNothing() {} })(); Now, I created a button section where if you press one button, a different xml file is loaded. Notice the section with the ////////////////////// However, upon clicking the button, nothing happens. The xml file itself is okay and loads the desired data. I also receive no errors in firebug. Any ideas why this happens? Thanks!

    Read the article

  • Google I/O 2010 - Moving beyond markers: Advanced Maps API customization

    Google I/O 2010 - Moving beyond markers: Advanced Maps API customization Google I/O 2010 - Moving beyond markers: Advanced Maps API customization Geo 301 Jez Fletcher, David Day With such a large number of Google Maps API sites online, it can be hard to make your site stand out from the crowd. This session covers ways in which you can enhance your Maps API application to truly differentiate it, including customizing your overlays, controls, and map. For all I/O 2010 sessions, please go to code.google.com From: GoogleDevelopers Views: 16 0 ratings Time: 36:38 More in Science & Technology

    Read the article

  • google maps everytime fails to place some markers on the map

    - by Luca
    hello! im trying to place like 130/140 markers on a custom google map. i inject the map with jquery and gmaps (http://gmap.nurtext.de/) everytime, at random (not related to specific markers) a lots of markers are not shown. firebug report this error: a is null and this error comes from this file: http://maps.gstatic.com/intl/it_ALL/mapfiles/285c/maps2.api/main.js if i refresh the page...some other markers are "hidden" and other ones are shown. anyone had this problem/can help me or suggest another safe way to show all markers? thanks a lot! EDIT: this is how i inject the map and the markers (with a lots of address, but in this example only few) $(document).ready(function() { $("#container").gMap( { scrollwheel: false, maptype: G_PHYSICAL_MAP, icon: { image: "files/images/gmap_pin.png", iconsize: [32, 37], iconanchor: [32, 37], infowindowanchor: [12, 0] }, address: "Milano", zoom: 4, markers: [ { address: "Viale Certosa, Milano" }, { address: "Viale Ceccarini, Milano" }, { address: "Viale Italia, Milano" }, { address: "Via Rodi, Milano" }, ] }); });

    Read the article

  • google maps api v2 - dynamic load (tens of thousands of) markers

    - by Adam
    Hello, how made with JavaScript+PHP+MYSQL and Google Maps API v2 dynamic load of markers? atm I have map follow example http://googlemapsapi.martinpearman.co.uk/infusions/google_maps_api/basic_page.php?map_id=8 but my marker_data_01.php (where are all markers listed - look code of example) have atm 4MB and will only have more, and more. So the question is: how load only this markers to marker_data_01.php (of some other modification of it, can be on same file as map, meaningless, I load it all from MySQL atm) what I look now: so for example (I dont know what number will good but I write this only for show what I wanna made OR JUST something like it), so top left corner for example have position: 10, top right corner for example have position: 30, bottom left corner for example have position: 5, bottom right corner for example have position: 15. -- so load only this markers what are in this box 10-30-5-15 with for example GET, and when I move map for example to 17-12-48-20 box then made next GET request and with this mysql quote and download next markers that what I see now, with this I can have map with unlimited markers, and when will be a lot of markers then clustering can link them, so with this ppl dont will need do "preload" of all markers DB (what have 4mb now and will have more), but only download that what they see at the moment, I know that is possible because a lot sites have it but I am not master of code langs, I know only a bit php and mysql (and html) :) // sorry for my english

    Read the article

  • Need help writing jQuery to loop through table and inject markers into google map?

    - by abemonkey
    I am new to jQuery. I've done some simple things with it but what I am attempting now is a over my head and I need some help. I am building a locator for all the firearms dealers in the US for a client. I am working within Drupal. I have a proximity search by zip code that works great. If you search by zip a list of paginated results shows up in an html table that can by paged through via ajax. I would like a map to be above this list with markers corresponding to the names and addresses being listed. I already have all the lat and long values in the table results. I want the script to update the markers and automatically zoom to fit the markers in the view when a user changes the sort order of the table or pages through the results. Also, I'd like to have a hover highlight effect over the rows of the table that simultaneously highlight the corresponding marker, and have a click on the table row equal a click on a marker that pops up a marker info window to be populated using jQuery to read the name and address fields of the table. Hope this all makes sense. I know I'm putting a lot out there, I'm not asking for someone to write the whole script, just wanted to give as many details as possible. Thanks for any help. I'm just lost when it comes to looping and moving data around. If you want to check out what I have so far on the project please visit: www.axtsweapons.com and login with the username: "test" and the password: "1234" and then visit this direct link: www.axtsweapons.com/ffllocator. For just a simple page that would be easy to manipulate and play with goto: http://www.axtsweapons.com/maptest.html Thanks!

    Read the article

  • What sort of loop structure to compare checkbox matrix with Google Maps markers?

    - by Kirkman14
    I'm trying to build a map of trails around my town. I'm using an XML file to hold all the trail data. For each marker, I have categories like "surface," "difficulty," "uses," etc. I have seen many examples of Google Maps that use checkboxes to show markers by category. However these examples are usually very simple: maybe three different checkboxes. What's different on my end is that I have multiple categories, and within each category there are several possible values. So, a particular trail might have "use" values of "hiking," "biking," "jogging," and "equestrian" because all are allowed. I put together one version, which you can see here: http://www.joshrenaud.com/pd/trails_withcheckboxes3.html In this version, any trail that has any value checked by the user will be displayed on the map. This version works. (although I should point out there is a bug where despite only one category being checked on load, all markers display anyway. After your first click on any checkbox, the map will work properly) However I now realize it's not quite what I want. I want to change it so that it will display only markers that match ALL the values that are checked (rather than ANY, which is what the example above does). I took a hack at this. You can see the result online, but I can't type a link to it because I am new user. Change the "3" in the URL above to a "4" to see it. My questions are about this SECOND url. (trails_withcheckboxes4.html) It doesn't work. I am pretty new to Javascript, so I am sure I have done something totally wrong, but I can't figure out what. My specific questions: Does anyone see anything glaringly obvious that is keeping my second example from working? If not, could someone just suggest what sort of loop structure I would need to build to compare the several arrays of checkboxes with the several arrays of values on any given marker? Here is some of the relevant code, although you can just view source on the examples above to see the whole thing: function createMarker(point,surface,difficulty,use,html) { var marker = new GMarker(point,GIcon); marker.mysurface = surface; marker.mydifficulty = difficulty; marker.myuse = use; GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); }); gmarkers.push(marker); return marker; } function show() { hide(); var surfaceChecked = []; var difficultyChecked = []; var useChecked = []; var j=0; // okay, let's run through the checkbox elements and make arrays to serve as holders of any values the user has checked. for (i=0; i<surfaceArray.length; i++) { if (document.getElementById('surface'+surfaceArray[i]).checked == true) { surfaceChecked[j] = surfaceArray[i]; j++; } } j=0; for (i=0; i<difficultyArray.length; i++) { if (document.getElementById('difficulty'+difficultyArray[i]).checked == true) { difficultyChecked[j] = difficultyArray[i]; j++; } } j=0; for (i=0; i<useArray.length; i++) { if (document.getElementById('use'+useArray[i]).checked == true) { useChecked[j] = useArray[i]; j++; } } //now that we have our 'xxxChecked' holders, it's time to go through all the markers and see which to show. for (var k=0; k<gmarkers.length; k++) { // this loop runs thru all markers var surfaceMatches = []; var difficultyMatches = []; var useMatches = []; var surfaceOK = false; var difficultyOK = false; var useOK = false; for (var l=0; l<surfaceChecked.length; l++) { // this loops runs through all checked Surface categories for (var m=0; m<gmarkers[k].mysurface.length; m++) { // this loops through all surfaces on the marker if (gmarkers[k].mysurface[m].childNodes[0].nodeValue == surfaceChecked[l]) { surfaceMatches[l] = true; } } } for (l=0; l<difficultyChecked.length; l++) { // this loops runs through all checked Difficulty categories for (m=0; m<gmarkers[k].mydifficulty.length; m++) { // this loops through all difficulties on the marker if (gmarkers[k].mydifficulty[m].childNodes[0].nodeValue == difficultyChecked[l]) { difficultyMatches[l] = true; } } } for (l=0; l<useChecked.length; l++) { // this loops runs through all checked Use categories for (m=0; m<gmarkers[k].myuse.length; m++) { // this loops through all uses on the marker if (gmarkers[k].myuse[m].childNodes[0].nodeValue == useChecked[l]) { useMatches[l] = true; } } } // now it's time to loop thru the Match arrays and make sure they are all completely true. for (m=0; m<surfaceMatches.length; m++) { if (surfaceMatches[m] == true) { surfaceOK = true; } else if (surfaceMatches[m] == false) {surfaceOK = false; break; } } for (m=0; m<difficultyMatches.length; m++) { if (difficultyMatches[m] == true) { difficultyOK = true; } else if (difficultyMatches[m] == false) {difficultyOK = false; break; } } for (m=0; m<useMatches.length; m++) { if (useMatches[m] == true) { useOK = true; } else if (useMatches[m] == false) {useOK = false; break; } } // And finally, if each of the three OK's is true, then let's show the marker. if ((surfaceOK == true) && (difficultyOK == true) && (useOK == true)) { gmarkers[i].show(); } } }

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >