• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Web App Longitude and Latitude

Community Beginner ,
Jun 06, 2013 Jun 06, 2013

Copy link to clipboard

Copied

I'm creating a webapp for a client that maps out a number of mines in Saskatchewan Canada. These mines are in remote locations and don't have a physical address or postal code. I have the Latitude and Longitude co-ordinates for each mine but I'm not sure how I get those into a web app so it will plot the map... any help would be awesome!

TOPICS
Web apps

Views

1.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jun 06, 2013 Jun 06, 2013

Copy link to clipboard

Copied

Web Apps in BC have built-in location-awareness to search for web app items by location but BC requires you have address information and they take that address information and generate a Latitude and Longitude from the address info you attach to your web app item.  Since you have no address information, BC can't generate your lat and long.

You are going to have to work up a Google Map on your own.  You'll have to add your own custom fields to the web app called "Location Latitude" and "Location Longitude".  You can't use "Latitude" and "Longitude" since BC already automatically creates/uses those tags for your web app item.

Depending on your javascript chops this could be a little difficult but the idea is on your page where you call the web app module to show the list of web apps that you embed a Google Map asynchronously using parts of this code: https://gist.github.com/thetrickster/5725102

Keep in mind your site should be HTML5 so make sure your doctype is setup as html5 first like in the link above.  You can also follow Google Maps Getting Started section too at https://developers.google.com/maps/documentation/javascript/tutorial

Before you do anything you need an API key for Google maps that's tied to your site.  After you've got the map working and setup following Google's guide you need to write another script that looks at the web app items on the page and grabs their latitude and longitude from your list view markup and plots those points on the map.

If you don't want to roll your own map you might want to see if you can try to get address info for those coordinates at http://geocoder.ca

Once you have address information, goto your Web App's settings and check the box "Allow proximity search".  Now, on your web app items you should see address information for each item in your BC Admin. Add the addresses generated from the geocoder site above and hopefully BC's internal geocoding might return you an accurate lat and long.  Once you have the address info in place for your web app items, goto the page you want to show the map on (or create a new page) and insert the Module > Web Apps > Show web app items on a map.  Insert that module and you should be all set.  If the lat and longs are off and it's not working you'll have to roll your own.  I do this sort of thing if you're interested or you can find anyone who knows HTML/CSS/Javascript to do it for you.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 06, 2013 Jun 06, 2013

Copy link to clipboard

Copied

Hey.

Some notes from the above post by trickster to be aware of:

- Dont need HTML5 to be able to use google maps API as a note on that.

- BC map output basics will work without doing all of the above as well if you want the basic output.

- IF you are not in a country with states the tags for lattitude and longitude in BC do not work.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jun 06, 2013 Jun 06, 2013

Copy link to clipboard

Copied

He doesn't have address info, only latitude and longitude-- will BC's web app items on a map work without address info? There's no place to insert lat and long into the web app location information-- only address info.  I thought that BC needed address info to geocode the lat and long.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 06, 2013 Jun 06, 2013

Copy link to clipboard

Copied

LATEST

IF there is code and state, yeah, but you are right, if nothing other then that wont work..

Not dissing the sollution at all - was spot on, but just wanted to add the few points to it
Will always let people know as well the BC stupidness with lat and long not working for other countries that dont have states (which is dumb)

Save anyone who comes across the threads a headache.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines