origo icon indicating copy to clipboard operation
origo copied to clipboard

Sharemap doesn't work when configuration is defined inline.

Open huggla opened this issue 1 year ago • 3 comments

The sharemap control is able to save the mapstate, but the given link doesn't retrieve it. Works when config is stored in separate json file.

<html>
	<head>
		<link href='css/style.css' rel='stylesheet'>
		<script src="js/origo.min.js"></script>
		<script>
			var json={
				"controls": [
					{
						"name":"mapmenu",
						"options":{
							"isActive":true
						}
					},
					{
						"name":"sharemap",
						"options":{
							"title":"Dela karta",
						        "storeMethod": "saveStateToServer",
							"serviceEndpoint": "../origoserver/mapstate"
						}
					}
				],
				"projectionCode": "EPSG:3857",
				"extent": [
					-20026376.39,
					-20048966.1,
					20026376.39,
					20048966.1
				],
				"center": [
					1770000,
					8770000
				],
				"resolutions": [
					1222.99
				],
				"layers": [{
					"name": "osm",
					"title": "OpenStreetMap",
					"type": "OSM",
					"visible": true
				}]
			};
		</script>
	</head>
	<body>
		<div id="app-wrapper"></div>
		<script>
			var origo = Origo(json);
		</script>	
	</body>
</html>

huggla avatar Dec 07 '23 13:12 huggla