Reinos.nl internet media examples

JS API general

Maps 5.0.1 Live

Markers, circles and a rectangle added from your own Javascript with the Javascript API: the places are geocoded in the browser, then drawn on the map.

Template
<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,
          color : "#BBD8E9",
          opacity : 0.9,
          weight : 2
        });
      });

      REINOS_MAPS.api("geocode", {
        address : "utrecht|harderwijk",
        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,
            color : "#BBD8E9",
            opacity : 0.8,
            weight : 2
          });
        }
      });

      REINOS_MAPS.api("fitMap", {
        mapID : "reinos_map_1"
      });
    }
  });
});
</script>

Build it in your own site

What this example needs in ExpressionEngine, step by step.

  1. Install Maps.
  2. Put the code in a template.

This example comes from the Maps docs: the preview runs exactly the code above.