Change data using Google Store Locator

Hi i’m using the Google Store Locator tut to work on somthing I’d like to create. After downloading all the source code everything is fine yet when I try to change the data (medicare.csv) everything goes blank. I understand using excel to to changes on the csv file is a problem.

All this leads me to think I’d be better off using the dynamic example where I can call the data from a mysql DB and upload from a CSV file no matter what IDE it came from?

Has anyone used this and if so are there any good examples I can look at - i’m getting frustrated!

Hi stephen,

Are you able to share a couple of rows from your CSV file? Also, have you changed any of the other files? I’ve downloaded the medicare example and I’m just having a play around to see how it works.

Hello sir,

I’ve only tried basic changes to the example - even changing the titles throws up problems. I changed Fcilty_nam to name in the csv and the

var store = new storeLocator.Store(row.uuid, position, features, {
      title: row.Fcilty_nam,

but to no avail.

I’ll get working on an idea and post - prehaps for future amending a JSON - PHP/MySql route would be better?

The other issue as well is the “Xcoord”,“Ycoord” - i’d rather use lat long that Google recognises. Not sure about this also?

The Xcoord and Ycoord are the longitude and latitude… the order in the CSV is the reverse of the order that you get them from google maps. In fact that could be why your data points are not showing on the map, if they’re in the wrong order.

I’m going to play around and i’ll report back - ive also seen a plugin that i’d like to take a look at as well.

Thanks for the advice (as always)!

Okay i’ve realised that using excel to modify the csv file is not good. It removes the " marks and therefore changes the file structure. Thanks fretburner as well on the co-ords realised after geocoding my data.

Anyone now of a good unbotrusive csv editor - dont want to use notepad++ and cant use excel… Google spreadsheets?

Okay i’d really like to pull my data from a mysql DB. I’ve set up the DB using a similar structure as the medicare.csv file -

However I want to change the medicare-dynamic-ds.js file to allow a connection to my DB.

I’ve also read that the example above uses deprecated mysql_ functions and should use a PDO method instead… to say i’m confused is an understatement.

What I would like to do is amend the line in the medicare-dynamic-ds.js file to allow a connection to be made in mySQL DB.

You’ll need to provide a URL where the JS can get the data in JSON format… once you’ve got the data from your DB, you’d do something like this:

header('Content-type: application/json');
echo ($_GET['callback'].'('.json_encode($data).');'); 

Did you manage to get it working using your custom CSV already?

Cheers Fretburner I’ll try this - yes the csv is now okay in part - noticed if i remove some fields then it messes up again. Think i getting there.