danagerous / jquery-ui-map

Automatically exported from code.google.com/p/jquery-ui-map
Apache License 2.0
0 stars 0 forks source link

Explicitly set "All" selected in google-maps-jquery-filtering.html AND new icons #8

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
To see problem with filter tag/value on page reload:
1. Demo: google-maps-jquery-filtering.html
2. Select a tag-filter other than All
3. Reload the page --> All new markers/locations are generated and shown but 
the selector still says what the last selection was, not All

One way to fix, in html add id="all":
<option value="all" id="all">&nbsp;All</option>

At end of gmap creation:
document.getElementById("all").selected=true;

To enhance look and feel of icons: 1) replace javascript with this block:
var tag = "Wifi";
var icon = new google.maps.MarkerImage('images/wifi.png');
for ( i = 0; i < 40; i++ ) {
    if ( i > 10 ) { tag = "Snowboarding"; icon = new google.maps.MarkerImage('images/snowboarding.png');}
    if ( i > 20 ) { tag = "Music"; icon = new google.maps.MarkerImage('images/music.png');}
    if ( i > 30 ) { tag = "Dancing"; icon = new google.maps.MarkerImage('images/dancing.png');}
    $('#map_canvas').gmap('addMarker', { 'tag':tag, 'title':tag, 'bound':false, 'icon': icon, 'position': new google.maps.LatLng(southWest.lat() + latSpan * Math.random(), southWest.lng() + lngSpan * Math.random()) } );
}

2) Put attached 4 icons in demos/images/
(images from http://code.google.com/p/google-maps-icons/ )

Original issue reported on code.google.com by libby.ba...@gmail.com on 24 May 2011 at 9:20

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by johansalllarsson on 14 Aug 2011 at 10:45