Maps example - JS API general
Template code
<script src="https://code.jquery.com/jquery-3.7.1.js" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4=" crossorigin="anonymous"></script>
{exp:reinos_maps:html_header}
{exp:reinos_maps:map
center:address="europa"
width="100%"
}
{exp:reinos_maps:html_footer}
<script>
$(function(){
REINOS_MAPS.api("geocode", {
address : "heerde|apeldoorn|amsterdam",
callback : function(result, type){
$.each(result.objects, function(k,v){
REINOS_MAPS.api("addMarker", {
mapID : "reinos_map_1",
lat: v.lat,
lng: v.lng,
title: v.city
});
REINOS_MAPS.api("addCircle", {
mapID : "reinos_map_1",
lat: v.lat,
lng: v.lng,
fillColor : "#BBD8E9",
fillOpacity : 0.3,
radius : 7000,
strokeColor : "#BBD8E9",
strokeOpacity : 0.9,
strokeWeight : 2,
zIndex : 1
});
});
REINOS_MAPS.api("geocode", {
address : "utrecht|hardewijk gelderland",
callback : function(result, type){
REINOS_MAPS.triggerEvent("addRectangle", {
mapID : "reinos_map_1",
bounds : [[result.objects[0].latitude,result.objects[0].longitude],[result.objects[1].latitude,result.objects[1].longitude]],
fillColor : "#BBD8E9",
fillOpacity : 0.3,
strokeColor : "#BBD8E9",
strokeOpacity : 0.8,
strokeWeight : 2,
zIndex : 1
});
}
});
REINOS_MAPS.api("fitMap", {
mapID : "reinos_map_1"
});
}
});
});
</script>