diff --git a/examples/google-map.html b/examples/google-map.html deleted file mode 100644 index 463c90834f..0000000000 --- a/examples/google-map.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - Google Maps integration example - - - - - -
- -
-
-
-
-
-
-
-
- -
- -
-

Google Maps integration example

-

Example of a GMaps map with an ol3 map as control, to give users a Google base map with ol3 content on top.

-
-

See the google-map.js source to see how this is done.

-
-
google
-
- -
- -
- - - - - - - diff --git a/examples/google-map.js b/examples/google-map.js deleted file mode 100644 index 43ae66c77a..0000000000 --- a/examples/google-map.js +++ /dev/null @@ -1,67 +0,0 @@ -// NOCOMPILE -// This example uses the GMapx v3 API, which we do not have an exports file for. -goog.require('ol.Map'); -goog.require('ol.View'); -goog.require('ol.interaction'); -goog.require('ol.interaction.DragPan'); -goog.require('ol.layer.Vector'); -goog.require('ol.proj'); -goog.require('ol.source.GeoJSON'); -goog.require('ol.style.Fill'); -goog.require('ol.style.Stroke'); -goog.require('ol.style.Style'); - - -var gmap = new google.maps.Map(document.getElementById('gmap'), { - disableDefaultUI: true, - keyboardShortcuts: false, - draggable: false, - disableDoubleClickZoom: true, - scrollwheel: false, - streetViewControl: false -}); - -var view = new ol.View({ - // make sure the view doesn't go beyond the 22 zoom levels of Google Maps - maxZoom: 21 -}); -view.on('change:center', function() { - var center = ol.proj.transform(view.getCenter(), 'EPSG:3857', 'EPSG:4326'); - gmap.setCenter(new google.maps.LatLng(center[1], center[0])); -}); -view.on('change:resolution', function() { - gmap.setZoom(view.getZoom()); -}); - -var vector = new ol.layer.Vector({ - source: new ol.source.GeoJSON({ - url: 'data/geojson/countries.geojson', - projection: 'EPSG:3857' - }), - style: new ol.style.Style({ - fill: new ol.style.Fill({ - color: 'rgba(255, 255, 255, 0.6)' - }), - stroke: new ol.style.Stroke({ - color: '#319FD3', - width: 1 - }) - }) -}); - -var olMapDiv = document.getElementById('olmap'); -var map = new ol.Map({ - layers: [vector], - interactions: ol.interaction.defaults({ - altShiftDragRotate: false, - dragPan: false, - rotate: false - }).extend([new ol.interaction.DragPan({kinetic: null})]), - target: olMapDiv, - view: view -}); -view.setCenter([0, 0]); -view.setZoom(1); - -olMapDiv.parentNode.removeChild(olMapDiv); -gmap.controls[google.maps.ControlPosition.TOP_LEFT].push(olMapDiv);