Multiple XML files using Jquery Store Locator Plugin

muttoros

New Member
I'm new to jQuery and have been playing with the jQuery store locator plugin.I was wondering if someone could point me in the right direction please. I have been trying to add multiple xml files to the map so that when a user selects say salmon, only the salmon markers show up, or if they select trout only the trout markers show up. I have tried doing this but not got anywhere with it.I was told it's not working because xmlLocation is being set then re-set in the same object inside $.extend. and that it was recommend that I put everything in one XML and distinguish the fish types in some tag, like the first word of description, then when it's read back you extract that word. But I'm a complete numb to all this so I didn't understand what they where trying to say.I would be very grateful for any help and I am also sorry if this is a repeat question I have tried searching for this answer online but couldn't find anything.Thank you in advancetrout.xml\[code\]<?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://earth.google.com/kml/2.2"><Document> <name>trout</name><description><![CDATA[Trout fishing (plain text version)]]></description><Placemark><name>some trout place - burnley</name><Snippet>some trout place in burnley </Snippet><description><![CDATA[<div dir="ltr">trout place 1 - burnley<br>some street<br>bb12 3ab<br>01234 567890</div>]]></description><Point><coordinates>-2.104521,57.145737,0.000000</coordinates></Point></Placemark><Placemark><name>Nelson</name><Snippet>Some trout place nelson</Snippet><description><![CDATA[<div dir="ltr">Some trout place nelson1 <br>some street<br>Nelson<br>Bb12 3ac<br>01234 567890</div>]]></description><Point><coordinates>-5.962432,54.570358,0.000000</coordinates></Point>\[/code\]salmon.xml\[code\]<?xml version="1.0" encoding="UTF-8"?><kml xmlns="http://earth.google.com/kml/2.2"><Document><name>Salmon</name><description><![CDATA[salmon fishing in the uk (plain text version)]]></description><Placemark><name>Burnley</name><Snippet>Salmon fishing place1 goes here</Snippet><description><![CDATA[<div dir="ltr">Salmon Fishing Place - Burnley<br>Some Street<br>Burnley<br>bb12 3ab<br>01234 567890</div>]]></description><Point><coordinates>-2.2450,53.7877,0.000000</coordinates></Point></Placemark><Placemark><name>Nelson</name><Snippet>Salmon fishing place2 goes herei</Snippet><description><![CDATA[<div dir="ltr">Salmon Fishing place2 - Nelson<br>Some Street<br>Nelson<br>BB12 3ac<br>01234 567890</div>]]></description><Point><coordinates>-5.962432,54.570358,0.000000</coordinates></Point></Placemark>\[/code\]This is where I am placing the files.Jquery.storelocator.js\[code\](function ($) {$.fn.storeLocator = function (options) {var settings = $.extend({ 'mapDiv': 'map', 'listDiv': 'list', 'formID': 'user-location', 'pinColor': 'fe7569', 'startPinColor': '66bd4a', 'pinTextColor': '000000', 'storeLimit': 10, 'distanceAlert': 60, 'xmlLocation': 'data/trout.xml', 'xmlLocation': 'data/salmon.xml', 'addressErrorMsg': 'Please enter valid UK address address or postcode', 'googleDistanceMatrixDestinationLimit': 25, 'defaultLat': 52.3038165, 'defaultLng': -1.081117, 'defaultLocationName': 'Northampton, United Kingdom'}, options);return this.each(function () { var $this = $(this); // global array of shop objects var _locationset = new Array(); var geocoder;\[/code\]
 
Back
Top