My Account     Contact Us     Cart

Create HTML5 Maps with MAP Web Author in Adobe Illustrator and How to Embed Them on your Website

 

What is HTML5?

HTML5 is the current major revision of HTML (Hypertext Markup Language), the core markup language of the Internet. One of its major development goals was to reduce the need for proprietary, plug-ins such as Adobe Flash and to provide new graphics drawing abilities to the canvas element of HTML5. Scripting (e.g. JavaScript) is used to draw graphics, animations, and display other types of content. The potential of applications in online mapping with HTML5 technology varies widely including uses in fields such as cartography, GIS, demographics, and statistics.

Introduction to HTML5 Map Web Author

As maps become more detailed and data sources becoming richer, the way we present multiple data layers and map projections in dynamic map zoom levels and extents, traditional web mapping techniques start to become too limited. While many current web maps are rendered and served through a server, this could limit the amount of data provided and be slow to transfer as more and more tiles are served. MAP Web Author uses a technique to make maps from Adobe Illustrator compatible with browsers that support HTML5, specifically the canvas element. The maps exported using MAP Web Author are not server-side rendered, instead, they are rendered on-the-fly and content dynamically changes when the map is panned or the map zoom level is changed. This ultimately produces a more flexible, interactive and dynamic map. An HTML5 map also has more efficient storage and requires less space than other web map technologies. Stored vector map data (points, lines, and areas) is more efficient than raster tiles and can be displayed at any scale and even styled using CSS. Since HTML5 technology replaces browser plug-ins like Flash or Java, web maps generated by MAPublisher are accessible on Android, iOS, and Windows mobile devices (smartphones and tablets).

Files created from export

After exporting your map using MAP Web Author to HTML5 format, several files will be created. A ready to use index.html file and an index_data folder. The index.html file contains pre-formatted code necessary to view your map. In most instances, you can simply open the file in a browser to view the web map.

The index_data folder contains all of the necessary map layer data, JavaScript files, and CSS files to display your map.

 

How to embed an HTML5 web map into your site

The viewer will be embedded inside of a div element in your page (the “container div”). The map view will fill the container div.

For mobile specific sites we recommend setting the width and height of the container div to 100%, then using max-width and max-height to limit the width to the size of the map. The style should fit in the head, like this:

<style>
	#map_container {
		max-width: 479px; 
		width: 100%;
		max-height: 320px;
		height: 100%;
	}
</style>

For standard websites we recommend explicitly setting a width and height of the container div. The style should fit in the head, like this:

<style>
	#map_container {
		width: 479px; 
		height: 320px;
	}		
</style>

The following script tags must be included in the head tag as well. These scripts contain JavaScript functions that allow the map to function, like so:

<script src="index_data/jquery-1.7.1.min.js"></script>
<script src="index_data/openseadragon-min.js"></script>
<script src="index_data/avenza-viewer.js">lt;/script>

Keep note that the prefixUrl points to the directory where your map data is stored. It should be a relative path to avoid cross-site access errors. The id is used below in the body of your page.

<script>
	var avenzaViewer;
	$(function () {
		
		AVENZA.initialize();
		avenzaViewer = AVENZA.embedViewer({
			id: 'map_container',
			prefixUrl: 'index_data/'
		});
	});
</script>

Within the body tag, place the div element where appropriate. Specifying the div element id initiates the JavaScript to display the HTML5 web map. If a browser that is not compatible is used, then the message is displayed.

<div id="map_container">
	<div style="display:none">
		<!-- 
		The message below will appear instead of the map if 
		a user connects with a browser that does not support 
		enough HTML5 for the map viewer to function. You may 
		wish to customize the message for your site.
		-->
		A web browser that supports HTML5 is required in order 
		to view this content. If you are seeing this message 
		then your current web browser does not. 
 
		Please upgrade.
</div>

 

More information and sample HTML5 maps can be found in the MAP Web Author section.


Leave a Reply





Blog Archive

October 2024 (1)
September 2024 (2)
August 2024 (2)
July 2024 (2)
June 2024 (1)
May 2024 (2)
April 2024 (2)
March 2024 (2)
February 2024 (1)
January 2024 (1)
December 2023 (1)
November 2023 (2)
October 2023 (2)
September 2023 (1)
August 2023 (1)
July 2023 (3)
June 2023 (1)
February 2023 (1)
January 2023 (2)
December 2022 (1)
November 2022 (2)
October 2022 (2)
September 2022 (1)
May 2023 (1)
August 2022 (2)
July 2022 (1)
June 2022 (2)
May 2022 (1)
February 2022 (1)
January 2022 (2)
August 2022 (1)
December 2021 (3)
November 2021 (5)
October 2021 (1)
September 2021 (3)
August 2021 (2)
July 2021 (1)
June 2021 (2)
May 2021 (2)
April 2021 (2)
March 2021 (3)
April 2021 (1)
February 2021 (1)
January 2021 (1)
November 2020 (1)
October 2020 (1)
June 2020 (2)
May 2020 (1)
April 2020 (3)
March 2020 (2)
December 2019 (1)
November 2019 (2)
September 2019 (1)
August 2019 (1)
July 2019 (1)
June 2019 (3)
May 2019 (4)
April 2019 (2)
March 2019 (1)
February 2019 (2)
January 2019 (3)
December 2018 (2)
November 2018 (1)
October 2018 (1)
September 2018 (2)
August 2018 (4)
July 2018 (2)
June 2018 (1)
July 2018 (1)
June 2018 (4)
May 2018 (1)
April 2018 (2)
March 2018 (4)
February 2021 (1)
February 2018 (1)
January 2018 (1)
November 2017 (1)
October 2017 (2)
August 2017 (2)
July 2017 (1)
March 2017 (1)
February 2017 (2)
January 2017 (2)
November 2016 (1)
January 2017 (1)
November 2016 (1)
October 2016 (2)
May 2016 (1)
March 2018 (1)
April 2016 (2)
December 2015 (2)
June 2015 (1)
May 2015 (1)
April 2015 (2)
December 2014 (4)
October 2014 (2)
May 2014 (4)
February 2014 (1)
October 2013 (3)
April 2013 (1)
January 2013 (2)
August 2012 (1)
October 2012 (1)
July 2012 (3)
May 2012 (2)
January 2012 (2)
August 2011 (1)
July 2011 (2)
June 2011 (2)
May 2011 (2)
March 2011 (1)
February 2011 (1)
January 2011 (5)
December 2010 (1)
November 2010 (1)
December 2010 (1)
November 2010 (1)
October 2010 (1)
August 2010 (4)
July 2010 (2)
June 2010 (3)
May 2010 (2)
April 2010 (2)
March 2010 (2)