Created
February 20, 2023 09:39
-
-
Save timotheemoulin/a593b89aaefbabdd4c1c91e16b47a30f to your computer and use it in GitHub Desktop.
Test OA MAP integration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" defer="true" src="//www.outdooractive.com/alpportal/oa_head.js?proj=api-aupaysdustbernard&key=IRFNHNTB-EMWGMGXI-4OSSAFZ3&lang=fr" done="true"> | |
</script> | |
<script> | |
(function (){ | |
$(function () { | |
oax.api.maps(initOAX); | |
function initOAX(oamaps, gm) { | |
// a single tour | |
var content = '53827260'; | |
var layerConfig = { | |
markersActive: true, | |
defaultIW: true | |
}; | |
// initialize GeomLayer | |
layer = new oamaps.GeomLayer(content, layerConfig); | |
layer.whenLoaded(initMap); | |
function initMap() { | |
var mapDiv = document.getElementById("outdooractive-map"); | |
var mapTypeIds = ['oa_map', 'oa_topo', 'oa_map_winter']; | |
var mapConfig = { | |
bounds: layer.getBounds(), | |
mapTypeId: mapTypeIds[0], | |
mapTypeControlOptions: {mapTypeIds: mapTypeIds} | |
}; | |
var map = oamaps.map(mapDiv, mapConfig); | |
// add GeomLayer to map | |
layer.setMap(map); | |
} | |
} | |
}); | |
})(jQuery); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Affiche les erreurs suivantes :
L'objet oax ne semble pas avoir été instancié complètement. Ci-dessous
oax
dans la console JS.