BC generates lat and long from the address and zip code fields. Sometimes these aren't always accurate I've found. Basically, when you save a web app item, BC goes out to a geocoding service and submits your address and zip code and in return they get latitude and longitudes. I'm not sure if it's the geocoding service or BC but the accuracy is questionable, in my opinion. If you can, double check that your address info is correct. If you are using 5 digit zip codes, try the longer zip codes for certain areas where you have accuracy issues.
I've had good success with differnt types of addresses for web apps. Some of my web app address cases are there is no address information (like area 51) or I only have lat and long or I only have a city name, etc.
You can see a demo at http://www.chrismatthias.com/demos/google-maps-web-app-demo
The script that powers the demo which you can look at or steal is at http://www.chrismatthias.com/js/bc-web-app-map-demo.js
If anyone else has any ideas how to fix his inaccurate lat and long from BC's geocoder, please chime in but I find it a little too unreliable.
The lat long tags only render data if you have a state.
Thanks Chris - We have created a custom map lat and longitude for the website and even put in our on lat long fields. It still shows it wrong
The address is actually an island. As you can see below it is getting the right lat and longitude but showing up differently on the map.
I agree with you that BC's mapping is quite off when it comes to addresses.
BTW - the demo is great. Probably going to use it on our next maps project.
Are you using the Lattitude & Longitude Tags? to render those values in your script?
I think you are using the "codeAddress()" function wrong. That function takes and address string like "1600 Pennsylvania Ave. Washington, D.C." NOT a lat and long.
If you look at my demo and check out the "setupMarkers()" function, that function is fired during the "initialize()" function which is run on page load. The "setupMarkers()" function finds each web app item on the page and loops through each one. When it is looping through your web app items it is looking for "data" attributes on those items. For my demo I have two places for lat and long in my item's data attributes. "data-address-latitude" is where I output BC's generated lat and long and "data-latitude" is a custom field in the web app just in case I only have lat and longitude and no address information.
The "setupMarkers()" function first combines the "data-street", "data-city", "data-state" and "data-zip" attributes on my web app item to create a full address string. Then, i check to see if there is any data in my custom "data-latitude" and "data-longitude" attributes. If there's no custom lat or long (meaning I didn't specifically add the custom lat and long to the web app item" it will use the "codeAddress()" function to go out to Google's geocoding service and generate more accurate lat and long from the address string we created.
The code is a little hard to follow and I didn't comment it but one day I will make this into a jquery plugin with instructions.
Just make sure you are using the codeAddress function correctly by passing in an address string.