OCAD Internet Map: Difference between revisions

From OCAD Wiki - English
Jump to navigation Jump to search
No edit summary
 
(47 intermediate revisions by 9 users not shown)
Line 1: Line 1:
==Export OIM==
==Export OIM [[File:Space.PNG]][[File:Mas40px.PNG|This function is available in OCAD Mapping Solution.|link=https://www.ocad.com/en/products/ocad-for-cartography]]==


[[File:Export.PNG]]
[[File:Export.PNG|250px]]




Choose '''Export OCAD Internet Map''' from '''File''' menu to export the map as OIM (OCAD Internet Map).  
Choose '''Export OCAD Internet Map''' from '''File''' menu to export the map as OIM (OCAD Internet Map).  
With OIM you can publish big OCAD maps on internet. You can insert the OCAD Internet Map to a HTML file.
With OIM you can publish big OCAD maps on internet. Additionally, it is possible to display and query Points of Interest (POI). You can insert the OCAD Internet Map to a HTML file.


* '''Resolution:''' Enter here the resolution of the GIF (for Java) or JPG (for Flash) file.
* '''Resolution:''' Enter here the resolution for the map tiles (GIF).
* '''Part of map:''' Activate this check box to export a part of the map. The map section will be shown with a rectangle on the drawing window. You can alter the rectangle with the mouse.
* '''Part of map:''' Activate this check box to export a part of the map. The map section will be shown with a rectangle on the drawing window. You can alter the rectangle with the mouse.


: Click the button Setup [[File:Setup.JPG|setup]] to define the part of map to be exported by coordinates. The dialog box Setup Part of Map (Export) appears.
: Click the Setup button [[File:Setup.JPG|setup]] to define the part of map to be exported by coordinates. The dialog box Setup Part of Map (Export) appears.
: Click the button Entire map [[File:EntireMap.JPG|entire map]] to export the entire map.
: Click the Entire map button [[File:EntireMap.JPG|entire map]] to export the entire map.
: Click the button To current view [[File:ToCurrentView.JPG|to current view]] to export the currently on the screen displayed map.
: Click the To current view button [[File:ToCurrentView.JPG|to current view]] to export the currently on the screen displayed map.
: If this check box is not active the entire map will be exported.
: If this check box is not active the entire map will be exported.


[[File:Hint.jpg]] It is also possible to choose a defined format like A4 landscape.
[[File:Hint.jpg]] It is also possible to choose a defined format like A4 landscape.


-> Click '''Export'''. The OIM Export Assistand dialog box appears:
-> Click '''Export'''. The '''Export OCAD Internet Map''' dialog box appears.


===OCAD Internet Map (OIM) Export Wizard===


=== OIM Export Assistant ===
====General Project Settings====


====General project settings====
* Map title - heading of the map
* Map subtitle - may be a copyright statement or similar
* Choose the favoured postition of the Map tile/ Map subtitle by clicking on the corresponding button.


{| style="float:right; background:transparent; padding:0px; margin:0px;"
'''Base map layout:'''
|- valign="top"
* Base layer name - name of the map (e.g. St. Moritz - OCAD Internet Map Example)
|[[File:OIMExportAssistant1.PNG]]
* Edit layer enable - enables the users the ability to draw on the map
|}
* Search with selection - search only in one POI category, for example streets
* Classic layout - use default layout for export
* Global searchbox - search for POI's (works only with PHP support)
* OCAD Slogan - displays OCAD slogan on your exported map
: POI selection hint - change default label for POI selection hint
: Search with selection heading - change default heading for Search with selection
: Global search box heading - change default heading for Global search box
: Search button (Global search box) - change default label for Search button


* Map title - Heading of the map
* Create tiles - need to be selected if the map tiles should be created, otherwise only the meta files are created
* Map subtitle - may be a copyright statement or similar
* Base Map Layout
:Base Layer Name - Name of the map (e.g. Citymap of Baar)
: Edit layer enable - Enables the users the ability to draw on the map
: Searchbox enable - Search for POI's (only works with PHP - Support)
: Zoom levels, calculated from map size and DPI (maximum possible zoom levels)
* Create tiles (need to be selected, otherwise only the meta files are created)


-> Click '''Next'''
-> Click '''Next'''


====Zoomlevel settings====
<gallery widths=400px heights=400px>
File:OIMExportAssistant1.PNG|General project settings
File:OIMExportAssistantZoomLevels.PNG|Zoomlevel settings
</gallery>


'''Relink''' or '''Change''' files of different zoom level.
====Zoom Level Settings====


-> Click '''Next'''
Select '''Zoom from''' and '''Zoom to''' levels which are created. Be aware that the overview map need a zoom level 0.
 
====Layout and functionality settings====
 
'''Controll Options:'''
* Show Layer Selector
* Show Overview Map
* Show Coordiantes
* Show Permalink


'''Color and Size Settings:
Generated levels are highlighted green, not created levels are grayed out. If the file is not found it is highlighted in red.
* Header Font Color
* Header Background Color
* Subheader Font Color
* Subhead Background Color
* Border Color
* Site Background Color


* Font Size
* '''Relink'''  - change the folder of all maps
* Subheader font Size
* '''Change'''  - change the map for the selected zoom level
* Border width
* '''Reset all to current file''' - currently opened file is taken for all zoom levels


-> Click '''Next'''
-> Click '''Next'''


====Points of interrest (POI)====
====Layout and Functionality Settings====
 
Choose '''Add''', the '''POI Selector''' dialog box appears:


* Title
'''Control Options:'''
* Dataset
* Show layer selector - enables the user to select different POI groups
* Condition
* Show overview map - enables the overview map feature
* Location field
: Maximize overview map - shows the map maximized by default
* Point of Interest Type:
* Show coordinates - show coordinates in the lower right corner
:: -Point (Vector)
* Show permalink - enables the user the ability to link to a specific zoom, map view and layers
:: -Icon (Information Bubbles)
* Map legend - if activated, you can select a file to display a map legend (jpg, png, gif)
* Advertisement - if activated, you can select a file for an advertisement (jpg, png, gif)


-> Click '''Next'''
'''Color and Size Settings:'''
* Header text color - color of the map title
* Header background color - background of the map title
* Subheader font color - color of the map subtitle
* Subheader background color - background of the map subtitle
* Border color - border color of the map
* Site background color - general site background


* Font size - font size of the map title
* Subheader font size - font size of the map subtitle (e.g. copyright)
* Border width - thickness of the border


Icon Settings:
<gallery widths=400px heights=400px>
* Icon
File:MapLayout.PNG|Layout and settings of the OCAD Internet Map
* Icon Offset
</gallery>
* Icon Size


-> Click '''Next'''
-> Click '''Next'''


====Points of Interest (POI)====
{| style="float:right; background:transparent; padding:0px; margin:0px;"
|- valign="top"
|[[File:OIMExportAssistantPOIOverview.png‎|thumb|left|400px|Overview about all POI's exported]]
|}
[[File:Hint.jpg]] Points of Interest (POI), like Restaurants, Hotels or train stations can only displayed in the web map, if they have been added to the OCAD map before.


General Settings
Choose '''Add''' to add a POI layer. The '''POI Selector''' dialog box appears:


* Short description
* Title - name of the layer
* Description
* Dataset - dataset to choose from
* URL field
* Condition - with an SQL expression the result set can be limited.<BR>
* Link name
e.g.:<BR>
* Link target
TYPE LIKE “Hotel”
or<BR>
symbolnumber = 521.000<BR>
* Location field - Name. It's the main name of the POIs, which is shown in the search
* Hover title on mouseover - a tooltip will be provided if the mouse moves over the POI
* Highlight POI through search result - an arrow will blink three times when the POI is selected from the search box
* Visible from zoom level - shows the entire overlay starting from the given zoom level. e.g.: show from zoom level 3 on
* Points of Interest type:
:: -Point (vector) - POIs are drawn as vector points on the map
:: -Icon (information bubbles) - POIs are represented by the provided icon file


-> Click '''Finish'''
-> Click '''Next'''


Choose direction and '''Save''' file. To see the internet map open the *.html file with double click in the browser.
===== POI Selector: Icon Settings (if choosen) =====
Icon settings (only if '''icon''' is chosen in the previous step):
* Icon - click the '''select''' button and choose a file (red background if file not found)
* Icon offset - offset from the anchor point
* Icon size - size of the icon (only in html, image will not be resized)


-> Click '''Next'''


* '''Zoom range:''' Enter the zoom range. Normally it is equal to the number of zoom levels.
===== POI Selector: Vector Settings (if chosen) =====
* '''Zoom levels:''' The OCAD Internet Map in Java Applet or Flash consists of GIF or JPG files in different resolution. Enter the number of zoom level. The resolution for the minimum magnification will be set to fit the map in the window. The resolution of the maximum magnification is set according the field Resolution. The resolution in-between will be calculated in a logarithmic interval.
Vector settings (only if '''vector''' is chosen in the previous step):
* '''Do not create tiles:''' Activate this option if you like to do only changes on the search function or on the hotspots without creating the map files newly.
* Point fill color - represents the main color (fill color) of the vector point.  
* '''Compress SVG:''' Activate this box to compress the SVG export file.
* Point stroke color - represents the outline color
* Point radius - size of the vector point
* Point fill opacity - applies to the main color
* Point stroke opacity - applies to the stroke color


[[File:Hint.jpg]] If you set both opacity values to 0, the vector points are transparent to the web map user. However,the points will still provide information for queries and mouseover events.
-> Click '''Next'''


* '''Layout:''' Choose this page to define the layout of the OCAD Internet Map.
===== POI Selector: General settings (if previously chosen Vecor Settings)=====
* '''Overview size:''' On internet map an overview map appears upper right. Enter here the Width and Height of the overview in pixels.
* '''Border width:''' Enter here the border width of the internet map in pixels. The default value is 5 pixels.
* '''Fill color:''' Click on this button to change the background color. The Color dialog appears.


* Short description - database field containing short description (important for search)
* Description - database field containing description for the info bubble or the right info box
* URL field - database field containing the URL
* Link name - database field containing a link name
[[File:Hint.jpg]] If the URL should be shown select the same field as for the URL
* Link target - link target for the browser
: _blank - opens the linked target in a new window or tab
: _parent - opens the linked target in the parent frame 
: _self - opens the linked target in the same window/tab as it was clicked
: _top - opens the linked target in the full body of the window


'''Maps:''' Choose this page to choose the maps.
URL, Link name and target are not mandatory fields.


The list shows one line for each zoom level. For each zoom level you can choose a map file to be used for this zoom level. The first line shows the map for the lowest magnification, the last line the map for the highest magnification.
-> Click '''Finish'''
If you do not make any change, the actual map is used for all zoom levels. If you want to use different maps for lower magnifications, you can choose here the desired map. To change the map file double click the corresponding line or select the line and click '''Change'''.
OCAD adjusts the maps using real world coordinates. When creating a special map for the lower magnifications, you should use '''Change Scale''' from the '''Map menu'''. This guarantees that scale and real world coordinates for the maps are correct.


* '''Change:''' Click this button to change the map file for the selected zoom level.
<gallery widths=200px heights=200px>
File:OIMExportAssistantPOISelector.PNG‎ |POI Selector
File:OIMExportAssistantPOIIconSettings.png | POI Icon settings (if chosen)
File:OIMExportAssistantPOIVectorSettings.png | POI Vector settings (if chosen)
File:OIMExportAssistantPOIDatafields.png | POI General settings
</gallery>


* '''Find:''' Choose this page to create a '''Find''' function for the Internet map. The Find function lets the user find street names, for example. OCAD will add a find box in the HTML file, where a name can be selected. For more information about calling the functions of the OCAD applet see the demo at
: [http://www.ocad.com/demo/scriptdemo.htm scriptdemo].
:To add a Find function, the corresponding objects must be linked to a database. See '''Creating''' a '''New Database Table''' for information on how to create a table and to link the objects.


* '''External scripting (JavaScript): ''' Activate this box if you want the scripting for the Java applet in the HTML file. Otherwise the scripting functions are in the Java applet.
Choose a directory and '''Save''' the file. To see the exported internet map, open the *.html file in the browser.
* '''Add:''' Click this button to add a find box or hotspots to the HTML file. The Edit Find/Hotspots dialog box appears.
* '''Edit:''' Click this button to edit the selected find box or hotspots. The Edit Find/Hotspots dialog box appears.
* '''Remove:''' Click this button to remove the selected find box or hotspots.
* '''Label for the selected box:''' Enter here the label for the selected box.
* '''Label for the find box:''' Enter here the label for the find box.


'''Hotspots'''
The search functionality only works on a server with PHP support otherwise the error message '''AJAX error: 0''' occurs.<br>
''(This function is only available in OCAD Professional!)''
[[File:ExportOimAjaxError0.png]]


Choose this page to add hotspots to the Internet map. Hotspots appear in programmable shape and color on the map. If the user clicks on a hotspot, the corresponding document will be displayed.
On the site [[HTML_Entities| HTML Entities]] the supported and convertable HTML characters can be seen.
OCAD writes the code for the hotspots to the HTML file. This is intended as sample code. You may copy this code to your HTML file and make changes according to your needs.
To add hotspots, the corresponding objects must be linked to a database. See '''Creating a New Database Table''' for information on how to create a table and to link the objects.


'''Title'''
[[File:Hint.jpg]] POI layers and POI are only displayed in the web browsers if the web map files have been uploaded on a web server with php installed.
Enter here the title for the hotspots and find function. The title appears in OIM map.
:''' Dataset:''' Select here the dataset which connects to a table with the URLs (www addresses).
:''' Condition:''' Enter here the condition for the find objects.
:''' Name field: ''' Select here the field in the table which contains the names for the find function.
:''' Pointer:''' Choose here the pointer type and the color for the find objects.


'''Hotspots'''
[[File:Hint.jpg]] Let’s assume you check your OIM in the browser after the export. The map tiles have been exported properly, but there’s something wrong with the POI. So, when re-exporting the map, just skip the option '''Create tiles''' in the General project settings. The export will thereby run much faster, especially for large maps. Make sure to export the same extent as before when skipping map tiles export.
:''' Show hotspots:''' Activate this box to add hotspots to the Internet map.
:''' URL field:''' Select here the field in the table which contains the URL.
:You can add absolute URLs starting with http:, ftp:, file: or mailto: URLs which do not start with one of these prefixes are treated as local addresses. They must be in the same folder as the applet or in a subfolder of it.


=== OCAD Internet Map Example St.Moritz===
Example of an OCAD Internet Map export: [http://ocad.com/demo/OIM_StMoritz/StMoritz.html Internet Map St. Moritz]


'''Examples:'''
== Extend OIM Functionality with Scripting==
: http://www.ocad.com
More advanced functions can be scripted. Examples can be found under [[OCAD_Internet_Map_scripting | OIM scripting]]
: mydoc.html
: mysubfolder/mysubfolderdoc.html
: '''Database queries:'''
: You can create database queries with '''Prefix''' and '''URL field'''. For example:
: Prefix: http://www.ocad.com/page.php?id=
: URL-ID: database id
: Prefix: Enter here the prefix for all URLs.
: Postfix: Enter here the postfix for all URLs.
: Target: Normally the document will be displayed in a new window. However it is possible to display it in a frame. Enter here the frame name or select one of the following targets:
: - _blank: Open page in new window.
: - _parent: open page in parent window of the frame.
: - _self: Open page in the same window.
: - _top: Open page in top window.
: '''Hint field:''' Select here the field in the table which contains the names for the hints.
: '''Type:''' Choose here the hotspot symbol type.
: '''Color:''' Choose the hotspot color.
: '''Show in zoom levels:''' Select here in which zoom levels the hotspot should appear.




== How To Add Second Base Map Layer to the OCAD Internet Map==


Previous Chapter: [[Server Client]]
* Export two OCAD Internet Map exports with a different base map (ex. one with a topographic map and the other with an aerial image). Save them to different folders.
* Navigate to the folder of the 2nd export and rename the sub folder ''map_tiles'' to ''map_tiles2''.
* Copy ''map_tiles2'' to the folder of the 1st OIM export. There should be now two sub folders ''map_tiles'' and ''map_tiles2''.
<gallery widths=246px heights=175px>
File:Oim2ndLayerFolders.png
</gallery>
* Navigate from the 1st OIM export folder to the sub folder ''scripts'' and open the file ''BasisFunctions.js'' in a text editor. Duplicate the function ''overlay_getTileURL'' and rename the 2nd to ''overlay_getTileURL2''. Within this ''''overlay_getTileURL2'' function rename ''map_tiles'' to ''map_tiles2''.
<gallery widths=705px heights=397px>
File:Oim2ndLayerBasisFunctions.png
</gallery>
* Open the OIM main html file from the OIM export folder in an editor and duplicate the ''basemap'' section and add them as ''basemap1'' and ''basemap2''. Change the layer name for ''basemap2'' to ''Orthophoto'' (or something else...) and call the ''overlay_getTileURL2''. Duplicate also ''map.addLayer(basemap)'' add it as ''map.addLayer(basemap1)'' and ''map.addLayer(basemap2)''.
<gallery widths=756px heights=267px>
File:Oim2ndLayerInitBasemap.png
</gallery>


Next Chapter : [[Workflows]]


----
Back to [[Main Page]]
Back to [[Main Page]]

Latest revision as of 16:28, 24 August 2021

Export OIM Space.PNGThis function is available in OCAD Mapping Solution.

Export.PNG


Choose Export OCAD Internet Map from File menu to export the map as OIM (OCAD Internet Map). With OIM you can publish big OCAD maps on internet. Additionally, it is possible to display and query Points of Interest (POI). You can insert the OCAD Internet Map to a HTML file.

  • Resolution: Enter here the resolution for the map tiles (GIF).
  • Part of map: Activate this check box to export a part of the map. The map section will be shown with a rectangle on the drawing window. You can alter the rectangle with the mouse.
Click the Setup button setup to define the part of map to be exported by coordinates. The dialog box Setup Part of Map (Export) appears.
Click the Entire map button entire map to export the entire map.
Click the To current view button to current view to export the currently on the screen displayed map.
If this check box is not active the entire map will be exported.

Hint.jpg It is also possible to choose a defined format like A4 landscape.

-> Click Export. The Export OCAD Internet Map dialog box appears.

OCAD Internet Map (OIM) Export Wizard

General Project Settings

  • Map title - heading of the map
  • Map subtitle - may be a copyright statement or similar
  • Choose the favoured postition of the Map tile/ Map subtitle by clicking on the corresponding button.

Base map layout:

  • Base layer name - name of the map (e.g. St. Moritz - OCAD Internet Map Example)
  • Edit layer enable - enables the users the ability to draw on the map
  • Search with selection - search only in one POI category, for example streets
  • Classic layout - use default layout for export
  • Global searchbox - search for POI's (works only with PHP support)
  • OCAD Slogan - displays OCAD slogan on your exported map
POI selection hint - change default label for POI selection hint
Search with selection heading - change default heading for Search with selection
Global search box heading - change default heading for Global search box
Search button (Global search box) - change default label for Search button
  • Create tiles - need to be selected if the map tiles should be created, otherwise only the meta files are created

-> Click Next

Zoom Level Settings

Select Zoom from and Zoom to levels which are created. Be aware that the overview map need a zoom level 0.

Generated levels are highlighted green, not created levels are grayed out. If the file is not found it is highlighted in red.

  • Relink - change the folder of all maps
  • Change - change the map for the selected zoom level
  • Reset all to current file - currently opened file is taken for all zoom levels

-> Click Next

Layout and Functionality Settings

Control Options:

  • Show layer selector - enables the user to select different POI groups
  • Show overview map - enables the overview map feature
Maximize overview map - shows the map maximized by default
  • Show coordinates - show coordinates in the lower right corner
  • Show permalink - enables the user the ability to link to a specific zoom, map view and layers
  • Map legend - if activated, you can select a file to display a map legend (jpg, png, gif)
  • Advertisement - if activated, you can select a file for an advertisement (jpg, png, gif)

Color and Size Settings:

  • Header text color - color of the map title
  • Header background color - background of the map title
  • Subheader font color - color of the map subtitle
  • Subheader background color - background of the map subtitle
  • Border color - border color of the map
  • Site background color - general site background
  • Font size - font size of the map title
  • Subheader font size - font size of the map subtitle (e.g. copyright)
  • Border width - thickness of the border

-> Click Next

Points of Interest (POI)

Overview about all POI's exported

Hint.jpg Points of Interest (POI), like Restaurants, Hotels or train stations can only displayed in the web map, if they have been added to the OCAD map before.

Choose Add to add a POI layer. The POI Selector dialog box appears:

  • Title - name of the layer
  • Dataset - dataset to choose from
  • Condition - with an SQL expression the result set can be limited.

e.g.:
TYPE LIKE “Hotel” or
symbolnumber = 521.000

  • Location field - Name. It's the main name of the POIs, which is shown in the search
  • Hover title on mouseover - a tooltip will be provided if the mouse moves over the POI
  • Highlight POI through search result - an arrow will blink three times when the POI is selected from the search box
  • Visible from zoom level - shows the entire overlay starting from the given zoom level. e.g.: show from zoom level 3 on
  • Points of Interest type:
-Point (vector) - POIs are drawn as vector points on the map
-Icon (information bubbles) - POIs are represented by the provided icon file

-> Click Next

POI Selector: Icon Settings (if choosen)

Icon settings (only if icon is chosen in the previous step):

  • Icon - click the select button and choose a file (red background if file not found)
  • Icon offset - offset from the anchor point
  • Icon size - size of the icon (only in html, image will not be resized)

-> Click Next

POI Selector: Vector Settings (if chosen)

Vector settings (only if vector is chosen in the previous step):

  • Point fill color - represents the main color (fill color) of the vector point.
  • Point stroke color - represents the outline color
  • Point radius - size of the vector point
  • Point fill opacity - applies to the main color
  • Point stroke opacity - applies to the stroke color

Hint.jpg If you set both opacity values to 0, the vector points are transparent to the web map user. However,the points will still provide information for queries and mouseover events. -> Click Next

POI Selector: General settings (if previously chosen Vecor Settings)
  • Short description - database field containing short description (important for search)
  • Description - database field containing description for the info bubble or the right info box
  • URL field - database field containing the URL
  • Link name - database field containing a link name

Hint.jpg If the URL should be shown select the same field as for the URL

  • Link target - link target for the browser
_blank - opens the linked target in a new window or tab
_parent - opens the linked target in the parent frame
_self - opens the linked target in the same window/tab as it was clicked
_top - opens the linked target in the full body of the window

URL, Link name and target are not mandatory fields.

-> Click Finish


Choose a directory and Save the file. To see the exported internet map, open the *.html file in the browser.

The search functionality only works on a server with PHP support otherwise the error message AJAX error: 0 occurs.
ExportOimAjaxError0.png

On the site HTML Entities the supported and convertable HTML characters can be seen.

Hint.jpg POI layers and POI are only displayed in the web browsers if the web map files have been uploaded on a web server with php installed.

Hint.jpg Let’s assume you check your OIM in the browser after the export. The map tiles have been exported properly, but there’s something wrong with the POI. So, when re-exporting the map, just skip the option Create tiles in the General project settings. The export will thereby run much faster, especially for large maps. Make sure to export the same extent as before when skipping map tiles export.

OCAD Internet Map Example St.Moritz

Example of an OCAD Internet Map export: Internet Map St. Moritz

Extend OIM Functionality with Scripting

More advanced functions can be scripted. Examples can be found under OIM scripting


How To Add Second Base Map Layer to the OCAD Internet Map

  • Export two OCAD Internet Map exports with a different base map (ex. one with a topographic map and the other with an aerial image). Save them to different folders.
  • Navigate to the folder of the 2nd export and rename the sub folder map_tiles to map_tiles2.
  • Copy map_tiles2 to the folder of the 1st OIM export. There should be now two sub folders map_tiles and map_tiles2.
  • Navigate from the 1st OIM export folder to the sub folder scripts and open the file BasisFunctions.js in a text editor. Duplicate the function overlay_getTileURL and rename the 2nd to overlay_getTileURL2. Within this ''overlay_getTileURL2 function rename map_tiles to map_tiles2.
  • Open the OIM main html file from the OIM export folder in an editor and duplicate the basemap section and add them as basemap1 and basemap2. Change the layer name for basemap2 to Orthophoto (or something else...) and call the overlay_getTileURL2. Duplicate also map.addLayer(basemap) add it as map.addLayer(basemap1) and map.addLayer(basemap2).



Back to Main Page