I am attempting to generate a bitmap image of a Map containing one or more InMemoryMarkerOverlays. Can you point me to any examples?
I can get my base layer to show up (LayerOverlay), but it does not contain any markers. Am I missing a step? Do I need to draw the marker layer serverside before calling GetBitmap?
I tried to set CurrentScale to the map like you did in your above code snippet but I get an error on the call to GetBitmap in System.Drawing that states “Parameter is not valid.” I used the same int values in your code snippet which I believe are the correct parameters for width and height respectively.
I am instantiating the Map server side - does that make a difference for GetBitmap?
The options of map are asynchronous on the client and server side, so you need to sent the map current extent and scale to server when you save map.
Please refer the following sample code:
Server side:
using System;
using System.Drawing;
using System.Web.Mvc;
using ThinkGeo.MapSuite;
using ThinkGeo.MapSuite.Layers;
using ThinkGeo.MapSuite.Mvc;
using ThinkGeo.MapSuite.Shapes;
namespace MapPrinter.Controllers
{
public class HomeController : Controller
{
// GET: Home
public ActionResult Index()
{
Map map = new Map(“Map1”,
new System.Web.UI.WebControls.Unit(100, System.Web.UI.WebControls.UnitType.Percentage),
new System.Web.UI.WebControls.Unit(1000, System.Web.UI.WebControls.UnitType.Pixel));
I could not get your example working properly. I get a 'World extent is not valid" error on GetBitmap on what should be valid parameters (I used the RectangleShape parameters you used for your CurrentExtent in the example above). Can you provide your client side function that calls the ClickEvent method? Is there anything else I could be doing incorrectly?