Shared Samples

Build, modify and run workflows on geospatial data using Spatial Modeler SDK. Build complex algorithms or run routine tasks, and build add-ons to ERDAS IMAGINE and GeoMedia.
Showing results for 
Search instead for 
Do you mean 

Map Overlay

by Technical Evangelist on ‎09-30-2019 06:38 AM (112 Views)

Abstract

The map overlay sample shows how you can display elements in the map. The AnimatedPositionPlugin displays three elements on the map that constantly change their colors and move while panning.

Bitbucket Link

 https://bitbucket.org/HGDN/hgdn_mae/src/master/Desktop/MapOverlay/

Description

When the map is ready, the AnimatedPositionPlugin creates the BlinkingLocationPane, which contains the elements that will be displayed on the map. In order to move the elements while panning,  MapListeners are registered to monitor the MouseEvents.

 

public class AnimatedPositionPlugin implements Plugin {
	
	private BlinkingLocationPane blinkingLocationPane;
	
	@Override
	public void onMapReady()
	{
		blinkingLocationPane = new BlinkingLocationPane();
		
		ApplicationContext.getBrowser().getMap().onmousedown((e) ->
		{
			...
		});
		
		ApplicationContext.getBrowser().getMap().onclick((e) ->
		{
			...
		});
		
		ApplicationContext.getBrowser().getMap().ondrag((e) ->
		{
			...
		});
		
		...
	}
}

 

 

Overview
Contributors