Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1290
Adding gifs/img onto Maps?
posted

Is it possible to add an image onto the map?

Or even for the shape selection sample, it possible to add a shape via the UI instead of defining it programmatically?

Parents
  • 1775
    Verified Answer
    posted

    Hi, cidolfus

    If your goal is to place the images in particular places on the map defined by geographic coordinates you can use custom markers. Please, look at the Marker Template sample. It shows you how you can configure custom markers and apply any custom logic to plot markers. You can look at this discussion in StackOverflow to see how you can load image data into a Canvas element and then get the base-64 encoded content of the image.

    If your scenario is different you can just load images in <img> elements and use absolute positioning to put the element on the correct place over the map control.

    Adding a shape via the UI depends on how shape data are stored in your application. I would suggest that you use a custom shape data source which means that you bind your own JavaScript array of objects or JSON which keeps information about shapes to the map control. If your user selects a specific shape you can just load that shape’s data and add it to the map’s data source. Look at the Configuring Geographic Shapes Series topic for an example how you can bind map to a custom data source.

    Cheers, Lazar

Reply Children
No Data