{"id":341,"date":"2016-08-11T08:56:42","date_gmt":"2016-08-11T12:56:42","guid":{"rendered":"http:\/\/salzlechner.com\/dev\/?p=341"},"modified":"2016-08-14T08:23:43","modified_gmt":"2016-08-14T12:23:43","slug":"mapping-in-dataflex-webapp","status":"publish","type":"post","link":"http:\/\/salzlechner.com\/dev\/2016\/08\/11\/mapping-in-dataflex-webapp\/","title":{"rendered":"Mapping in DataFlex WebApp"},"content":{"rendered":"<p>We have been using Maps in our desktop applications for a long time. We have used several different mapping solutions depending on the needs of the application ranging from special Law Enforcement maps to simple standard maps.<\/p>\n<p>For some projects we used Microsoft MapPoint. MapPoint was a nice mapping solution that provided a nice COM Interface, had local maps, did routing and had a simple licensing model<\/p>\n<p>MapPoint was discontinued and we had to find a different solution for our desktop applications. We also needed a solution for web applications as well as native mobile apps for iOS, Windows Universal and Android.<\/p>\n<p>Looking at different mapping solutions we started using several different solutions for our projects. Partly because of features but also because of licensing. Some mapping solutions provide free licensing for certain uses, some have a simple commercial licensing scheme, etc.<\/p>\n<p>For DataFlex WebApp we built a mapping library that currently consists of the following 3 mapping solutions<\/p>\n<p><strong>Static MapQuest Maps<\/strong><br \/>\nMapQuest provices an interface to retrieve static map images based on location with added markers, etc. These maps are static images that can be used for example in reporting and similar areas were a dynamic map is not needed.<br \/>\nThe mapping data is provided by Mapquest and there is a limited number of free transactions and after that a decent commercial use licensing structure.<\/p>\n<p><strong>Dynamic Leaflet based Maps<\/strong><br \/>\nLeaflet is a generic JavaScript mapping API that allows us to use maps from different providers. Leaflet maps are fully dynamic and the API comes with a large number of features.<br \/>\nLeaflet maps can be used with OpenStreetMaps, a free mapping provider or can also be used with MapQuest maps.<\/p>\n<p><strong>Google Maps<\/strong><br \/>\nWe also added a class to support Google Maps in your DataFlex WebApp projects<\/p>\n<p>Here is a simple example on showing a map in Google Maps<\/p>\n<pre class=\"lang:default decode:true\">Object oMap is a cszGoogleMap \r\n    \/\/ set zoom level\r\n    Set piZoom to 16           \r\nEnd_Object        \r\n\r\nObject oShowLatLonBtn is a cWebButton\r\n    Set psCaption to \"Show Lat\/Lon\"\r\n        \r\n    Procedure OnClick\r\n        WebSet psLongitude of oMap to -80.243073\r\n        WebSet psLatitude of oMap to 27.146106\r\n                \r\n        Send RequestShowMapLatLon to oMap\r\n    End_Procedure\r\nEnd_Object\r\n<\/pre>\n<p>Another example calculating a route using Leaflet based Maps with MapQuest data<\/p>\n<pre class=\"lang:default decode:true \">Object oMap is a cszGoogleMap \r\n    \/\/ set zoom level\r\n    Set piZoom to 16           \r\nEnd_Object        \r\n\r\nObject oShowLatLonBtn is a cWebButton\r\n    Set psCaption to \"Show Lat\/Lon\"\r\n        \r\n    Procedure OnClick\r\n        WebSet psLongitude of oMap to \"-80.200886\"\r\n        WebSet psLatitude of oMap to \"27.202678\"\r\n                \r\n        Send ClearRouteLocations to oMap\r\n        Send AddLocation to oMap 'Miami, FL' 'Miami, FL'\r\n        Send AddLocation to oMap 'Ft Lauderdale, FL' 'Ft Lauderdale, FL'\r\n        Send AddLocation to oMap \"4765 SE Chiles CT, Florida\" \"Haunted Mansion\"\r\n\r\n        Send RequestShowMapRoute to oMap\r\n    End_Procedure\r\nEnd_Object\r\n<\/pre>\n<p>here is what this looks like in a webapp<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"http:\/\/starzen.com\/wp-content\/uploads\/2016\/08\/leafletroute.png\" alt=\"\" width=\"825\" height=\"595\" \/><\/p>\n<p>This among other controls are available at <a href=\"http:\/\/www.starzen.com\" target=\"_blank\">StarZen Technologies, Inc<\/a><\/p>\n<div>\n\n\t\t<div class='author-shortcodes'>\n\t\t\t<div class='author-inner'>\n\t\t\t\t<div class='author-image'>\n\t\t\t<img src='http:\/\/salzlechner.com\/dev\/wp-content\/uploads\/sites\/2\/2016\/02\/mike5crop-566174_60x60.jpg' alt='' \/>\n\t\t\t<div class='author-overlay'><\/div>\n\t\t<\/div> \n\t\t<div class='author-info'>\n\t\t\tMichael Salzlechner is the CEO of StarZen Technologies, Inc.<\/p>\n<p>He was part of the Windows Team at Data Access Worldwide that created the DataFlex for Windows Product before joining <a href=\"http:\/\/starzen.com\">StarZen Technologies<\/a>. StarZen Technologies provides consulting services as well as custom Application development and third party products specifically for DataFlex developers<\/p>\n\t\t<\/div>\n\t\t\t<\/div>\n\t\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>We have been using Maps in our desktop applications for a long time. We have used several different mapping solutions depending on the needs of the application ranging from special Law Enforcement maps to simple standard maps.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","ngg_post_thumbnail":0,"footnotes":""},"categories":[27],"tags":[],"class_list":["post-341","post","type-post","status-publish","format-standard","hentry","category-dataflex-webapp"],"_links":{"self":[{"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/posts\/341","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/comments?post=341"}],"version-history":[{"count":3,"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/posts\/341\/revisions"}],"predecessor-version":[{"id":362,"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/posts\/341\/revisions\/362"}],"wp:attachment":[{"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/media?parent=341"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/categories?post=341"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/tags?post=341"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}