Online Map Help

Discussion in 'Web Design and Development' started by JackT06, Nov 6, 2010.

  1. JackT06 macrumors 6502

    JackT06

    Joined:
    Jul 24, 2009
    #1
    Hello,

    I am looking at puttting a map on my website with a list of DofE Centres. What i need is a map, which people can see a DofE centre click on it, give some some more details.
    Something like google maps, with the personalised maps.

    I have tried google, but i ahd two problems with it, and they were that

    1) The map is for the whole of the world. I only want it to display Hampshire.
    2) The google reviews.

    An example of what i want is Here.

    Thanks,
    Jack
     
  2. Dunmail macrumors regular

    Joined:
    Mar 27, 2009
    Location:
    Skipton, UK
    #2
    With Google maps you can set the centre of the map and its zoom level programmatically. You can also ask google maps to set the zoom level so that it is optimised for the set of points on the map.

    Here's some rough code, assume that there's an array of points to add to the map - pts:
    Code:
    // Create a "group" for the points we will be adding
    var bounds=new GLatLngBounds();
    for(i = 0; i < pts.length; i++)
    {
      bounds.extend(new GLatLng(pts[i].lat, pts[i].lon));
    }
    // Get Google to figure out how much to zoom the map
    map.setZoom(map.getBoundsZoomLevel(bounds));
    // And tell it where to centre it.
    map.setCenter(new GLatLng(area.lat, area.lon));
    
    I'm not sure what you mean by "reviews", do you mean "views"? I.e. road, satellite, hybrid? If you want to add overlays of local authority areas then you will have to create these yourself - check the google maps documentation.
     

Share This Page