https://bugzilla.wikimedia.org/show_bug.cgi?id=44869

       Web browser: ---
            Bug ID: 44869
           Summary: Ability to add custom maptypes with the googlemaps
                    service
           Product: MediaWiki extensions
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: Unprioritized
         Component: Maps
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected],
                    [email protected]
    Classification: Unclassified
   Mobile Platform: ---

It would be great to be able to add custom map types to the googlemaps service.
In my specific case, for instance, I would like to overlay the map offered by
the Norwegian Mapping Authority (Statens Kartverk) alongside Google's terrain
map. Documentation for how to do this can be found here:
https://developers.google.com/maps/documentation/javascript/maptypes#CustomMapTypes

Using a practical example, with the Norwegian Mapping authority as described,
the Javascript code would/could like like this:

function StatkartMapType(name, layer) {
  this.layer = layer
  this.name = name
  this.alt = name
  this.tileSize = new google.maps.Size(256,256);
  this.maxZoom = 19;
  this.getTile = function(coord, zoom, ownerDocument) {
    var div = ownerDocument.createElement('DIV');
    div.style.width = this.tileSize.width + 'px';
    div.style.height = this.tileSize.height + 'px';
    div.style.backgroundImage =
"url(http://opencache.statkart.no/gatekeeper/gk/gk.open_gmaps?layers="; +
this.layer + "&zoom=" + zoom + "&x=" + coord.x + "&y=" + coord.y + ")";
    return div;
  };
}

var map;

function initialize() {
  var mapOptions = {
    zoom: 8,
    center: new google.maps.LatLng(60,9),
    mapTypeControlOptions: {
      mapTypeIds: ['topo2', google.maps.MapTypeId.TERRAIN]
    }
  };
  map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
  map.mapTypes.set('topo2',new StatkartMapType("S.Kartverk", "topo2"));
  map.setMapTypeId('topo2');
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to