From the course: JavaScript for Web Designers

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Change the center point

Change the center point - JavaScript Tutorial

From the course: JavaScript for Web Designers

Start my 1-month free trial

Change the center point

- [Instructor] Instead of displaying London, let's move this map so it displays where the store is actually located at this address. Looking at the code, I can see here in the configuration object, that I have a center configuration, which is a location and it needs latitude and longitude. I don't happen to know what the latitude and longitude is of that address for the store. So we need to look that up. In other words, we need geocoding. There are online services that can do this for us. I'm going to copy the address. Like gpsisualizer.com offers one. But we're already tied into the Bing Maps API. So why don't we take a look at their REST services page that mentions geocoding. Going to just do an on page search for geocoding. Here we go. So they're filing that under the locations section. We can take a look at that. Okay, find a location by address. That's perfect. That's just what I want. So let's see what this…

Contents