This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
|
storelocator:frontend-use [2013/02/18 18:19] jamby77 |
storelocator:frontend-use [2013/04/30 21:47] (current) jamby77 |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ===== Using frontend interface ===== | ||
| + | ==== Default route to map ==== | ||
| + | |||
| + | Inital default route to map page is ''/ | ||
| + | |||
| + | ==== Initial page ==== | ||
| + | |||
| + | Upon map page load, all applicable locations will be displayed. Locations can be limited from several things. | ||
| + | |||
| + | - If you have **Default Country** configured in [[main-config|main config]], locations from that country only will be shown. | ||
| + | - Only locations associated with current store or no store at all will be displayed. This is setup per [[location-config|location]]. | ||
| + | - If a search is made, then only locations matching the above conditions and fulfilling search criteria will show. | ||
| + | | ||
| + | If **Default Location Address** is selected, it will be centered on map and zoomed in after map loads. | ||
| + | |||
| + | ==== Map page elements ==== | ||
| + | |||
| + | Map page consists on few areas. | ||
| + | - **Search form** - here you perform searches for locations near you. | ||
| + | - **Locations sidebar** - initial location list, search results list and directions list will be displayed here | ||
| + | - **Map** - standard features Google map, that can be displayed as road map or satellite image map. It also displays each location' | ||
| + | - **Map footer** - footer contains list of tags, a **Show all** and a **Reset Locations** text buttons | ||
| + | |||
| + | {{: | ||
| + | |||
| + | ==== Using map ==== | ||
| + | |||
| + | Map can be panned and zoomed using default Google map controls. When you click on a sidebar entry, it is centered on the map and zoomed at its pre-defined zoom level (default map zoom level is used if location does not have this defined). | ||
| + | Also info window pops up on the map displaying location information such as title, display address, phone web or e-mail link. | ||
| + | Clicking on any of the tags bellow the map, filters current list of locations by those tags. Only locations that have clicked tag in their **Store type** list will be shown. | ||
| + | To show all current locations, click **Show all** link next to tags. | ||
| + | |||
| + | {{: | ||
| + | |||
| + | After performing search new list of locations is loaded, most often it will be a sub selection of initial locations. To show all initial locations click **Reset locations** | ||
| + | |||
| + | {{: | ||
| + | |||
| + | ==== Searching ==== | ||
| + | |||
| + | Search box above the map allows user to search for store locations placed within pre selected radius from the searched address. | ||
| + | User can use for search term anything that Google understands. This includes exact addresses, location names, landmark names, zip codes etc. | ||
| + | Only locations falling within selected radius will be considered. User can also search for specific location using its name or part of it. | ||
| + | When performing search by name, radius is not taken into account. | ||
| + | |||
| + | {{: | ||
| + | |||
| + | ==== Directions ==== | ||
| + | |||
| + | After performing a search and receiving result, user has the option to get directions from search position to any of the listed results. | ||
| + | To do that, user must click on 'Get directions' | ||
| + | |||
| + | {{: | ||
| + | |||
| + | This will result in a list of turn by turn directions bellow result location and route line displayed on the map. | ||
| + | By clicking on each step user will be shown closer view of that section of the route. For the moment only driving directions are available. | ||
| + | Note: if search performed is by store name, directions are not available. | ||
| + | |||
| + | {{: | ||
| + | |||
| + | ==== Customization ==== | ||
| + | |||
| + | All elements of the page have class names and IDs that allow for map and form appearance customization. | ||
| + | Featured locations by default have a **" | ||
| + | |||
| + | {{: | ||
| + | |||
| + | Sidebar entries, marker info window contents and directions elements can be greatly modified from within ''/ | ||
| + | Any of them is generated by customizable javascript code. You can provide your own functions to alter the html created. Each function accepts a location object in JSON format. | ||
| + | An example: | ||
| + | <code javascript> | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | </ | ||
| + | Initializing store locator javascript object accepts a configuration object with following structure: | ||
| + | |||
| + | <code javascript> | ||
| + | { | ||
| + | mapEl: ,// id of HTML element that will load the map, | ||
| + | sidebarEl: ,// id of HTML element that will hold sidebar, | ||
| + | searchUrl: ,// search backend URL, DO NOT CHANGE IT unless you modify backend too, | ||
| + | scale_icon: | ||
| + | initial_locations: | ||
| + | min_zoom: ,// minimal map zoom, it is taken from store configuration, | ||
| + | defaultLocation: | ||
| + | units: ,// map units, it is taken from store configuration, | ||
| + | route_not_found: | ||
| + | generateSidebarHtml: | ||
| + | generateDirectionsElement: | ||
| + | generateMarkerHtml: | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | If you decide to provide custom HTML generation functions, make sure to keep any classes and IDs used to preserve all functionality. | ||
| + | |||
| + | ==== Use in CMS page/block ==== | ||
| + | |||
| + | If you want to show locations as part of a CMS page or static block, you can do so by adding the following where you want to see the map: | ||
| + | <code php> | ||
| + | {{block type=" | ||
| + | </ | ||
| + | This alone however is not enough, you should also import JavaScript files that are used by the module. | ||
| + | To do that you need to add to '' | ||
| + | <code xml> | ||
| + | < | ||
| + | <action method=" | ||
| + | <action method=" | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | The above can be done for CMS pages only, if you are using it in CMS static block you should find another way of adding the above XML layout update. | ||