// create a map that replaces the default service with
// one using a string for the src property instead of a function
var map = $("#map").geomap({
center: [-71.0595678, 42.3604823],
zoom: 8,
services: [ {
id: "osm-string-src",
type: "tiled",
src: "http://tile.openstreetmap.org/{{=zoom}}/{{=tile.column}}/{{=tile.row}}.png"
} ]
});
<div id="map">
</div>
<div class="info">
<h1>string service src</h1>
<p>This example shows how you can set a service's src property to a jsRender template string.</p>
<p>The src property of the service object for this map is set to:</p>
<p>"http://tile.openstreetmap.org/{{=zoom}}/{{=tile.column}}/{{=tile.row}}.png"</p>
</div>
html
{
font:13px/1.231 Calibri,Arial,sans-serif; *font-size:small;
}
.info
{
background: #fff;
border-radius: 8px;
box-shadow: -4px 4px #444;
opacity: .8;
padding: 8px;
width: 95%;
}
fieldset { border: none; }
legend {
font-size: 14px;
font-weight: bold;
}
#map
{
position: fixed;
left: 0;
top: 0;
right: 0;
bottom: 0;
}
External resources loaded into this fiddle: