GPS Visualizer

Filtering markers using a text pattern

There are many different ways you can set up filtering of markers on a Google Map based on the markers' attributes. This page demonstrates four possibilities: a form, a drop-down menu, radio buttons, and plain text links.

All examples use the GV_Filter_Markers_With_Text() function, whose two named parameters are "field" and "pattern". If you don't specify a field, both the name and the description are searched. So a very simple use of this function would look like this: GV_Filter_Markers_With_Text({ field:'', pattern:'GPS' }) -- this would select markers whose name or description contained the text "GPS".

If you know how to create "regular expression" patterns, you can use them. For example, the following function would select only markers whose name began with the letters A through F: GV_Filter_Markers_With_Text({ field:'name', pattern:'^[A-F]' })

There's also a "zoom" option available, which will cause the map to pan and zoom to fit the area described by the markers that are visible: GV_Filter_Markers_With_Text({ field:'name', pattern:'^[A-F]', zoom:true })

This map was created using GPS Visualizer's do-it-yourself geographic utilities.

Please wait while the map data loads...