Static Maps API - ArcGIS (Code generator)

This generator allows you to test the custom class staticmap.js and generate a sample code to generate a static image.
(This generator does not include xoffset & yoffset in markers but the class does.)

Source code:

<html>
<head>
   <script type="text/javascript">
    var dojoConfig = (function(){
        var base = "http://esri-es.github.io/Static-Maps-API-ArcGIS"
        return {
            async: true,
            isDebug: true,
            packages:[{
                name: 'esriES', location: base + '/js', main: "staticmap"
            }]
        };
    })();
    </script>

    <link rel="stylesheet" href="http://js.arcgis.com/3.14/esri/css/esri.css">
    <script src="http://js.arcgis.com/3.14/"></script>

    <script type="text/javascript">
    require([
        "esriES/staticmap",
        "dojo/domReady!"
    ], function(StaticMap) {
        staticMap = new StaticMap();

        var options = {
            basemap: "streets",
            zoom: 3,
            address: "Balcon de Europa, Nerja",
            markers:[
                {
                    latitude: 36.744426,
                    longitude: -3.875497,
                    color: "orange",
                    yoffset: 10
                },
                {
                    latitude: 36.745053,
                    longitude : -3.877257,
                    color: "purple"
                }
            ],
            size: [510, 250],
            format: "PNG32"
        };

        staticMap.getImage(options).then(function(imageURL){
            document.getElementById("staticImage").src = imageURL;
        });

    });
    </script>
</head>
<body>
    <img src="" id="staticImage">
</body>
</html>
Fork me on GitHub