| View previous topic :: View next topic |
| Author |
Message |
dvs_code AFC Team

Joined: 09 May 2006 Posts: 2131
|
Posted: Thu Jan 24, 2008 8:53 am Post subject: UMap Providers |
|
|
One of the greatest features in our brand new UMap component is the Provider class. This class handles map types, tile layers and the loading of external resources: settings, language and copyrights. You can create Provider subclasses to create custom tile provider services and add you own map types.
By default UMap uses GoogleProvider class that represents Google tile service. GoogleProvider also uses our site for settings.xml file, langugage and copyright proxy scripts. If you don't want UMap to connect to our server you can change the urls GoogleProvider uses, so that it will connect to your server instead. Please be aware that you should update the map version, and all the paths manually if anything changes.
Here is a simple example:
| Code: | import com.afcomponents.umap.core.UMap;
import com.afcomponents.umap.providers.google.GoogleProvider;
// create map and attach it to stage
var map:UMap = new UMap();
map.setSize(stage.stageWidth, stage.stageHeight);
this.addChild(map);
// define GoogleProvider with custom paths
var settings:URLRequest = new URLRequest("http://umap.s3.amazonaws.com/assets/xml/GoogleSettings.xml?rand=" + Math.random());
var language:URLRequest = new URLRequest("http://maps.google.com/maps?file=api&v=2")
var copyright:URLRequest = new URLRequest("http://www.afcomponents.com/proxy/g_map_as3/copyright.php");
map.setProvider (new GoogleProvider(false, settings, language, copyright)); |
Here are the details on each path:
1. settings.xml file - describes the map types that should be implemented with the provider. You can see the content of this file on our server: http://umap.s3.amazonaws.com/assets/xml/GoogleSettings.xml
| Code: | <GMap>
<logo>http://umap.s3.amazonaws.com/assets/img/GoogleLogo.png</logo>
<mapType>
<name>map</name>
<textColor>0x000000</textColor>
<linkColor>0x7777CC</linkColor>
<layer>
<minZoom>0</minZoom>
<maxZoom>17</maxZoom>
<url><![CDATA[[server]/mt?n=404&v=[version]&x=[x]&y=[y]&zoom=[zoom]]]></url>
<version>ap.80</version>
<servers>
<url>http://mt0.google.com</url>
<url>http://mt1.google.com</url>
<url>http://mt2.google.com</url>
<url>http://mt3.google.com</url>
</servers>
</layer>
</mapType>
<mapType>
<name>satellite </name>
<textColor>0xFFFFFF</textColor>
<linkColor>0xFFFFFF</linkColor>
<layer>
<minZoom>0</minZoom>
<maxZoom>19</maxZoom>
<url><![CDATA[[server]/kh?n=404&v=[version]&t=[t]]]></url>
<version>29</version>
<servers>
<url>http://khm0.google.com</url>
<url>http://khm1.google.com</url>
<url>http://khm2.google.com</url>
<url>http://khm3.google.com</url>
</servers>
</layer>
</mapType>
<mapType>
<name>hybrid</name>
<textColor>0xFFFFFF</textColor>
<linkColor>0xFFFFFF</linkColor>
<layer>
<minZoom>0</minZoom>
<maxZoom>19</maxZoom>
<url><![CDATA[[server]/kh?n=404&v=[version]&t=[t]]]></url>
<version>29</version>
<servers>
<url>http://khm0.google.com</url>
<url>http://khm1.google.com</url>
<url>http://khm2.google.com</url>
<url>http://khm3.google.com</url>
</servers>
</layer>
<layer>
<minZoom>0</minZoom>
<maxZoom>17</maxZoom>
<noError>true</noError>
<url><![CDATA[[server]/mt?n=404&v=[version]&x=[x]&y=[y]&zoom=[zoom]]]></url>
<version>apt.80</version>
<servers>
<url>http://mt0.google.com</url>
<url>http://mt1.google.com</url>
<url>http://mt2.google.com</url>
<url>http://mt3.google.com</url>
</servers>
</layer>
</mapType>
</GMap> |
2. language - is a file that contains the map language data. It is a regular google maps api file, that is loaded by javascript map api. We use a special proxy that let's you load this api with different language setting. You can pass your request through your proxy to Google: http://maps.google.com/maps?file=api&v=2. If you want to embed your Google API key, you can add it to this link &key=my_google_api_key, but I don't believe it is necessary. Here is a sample .php proxy:
| Code: | <?php
include('http://maps.google.com/maps?file=api&v=2&key=my_api_key');
?> |
3. copyright - is a special proxy that redirects the copyright request to Google server. Here is a sample .php proxy file that you can use on your server:
| Code: | <?php
include('http://maps.google.com/maps?spn='.$_GET['spn'].'&z='.$_GET['z'].'&vp='.$_GET['vp'].'&t='.$_GET['t']);
?> |
Please feel free to post your questions, bug reports and ideas in this thread. _________________ Dmitry Stolyarov
AFC Team
Last edited by dvs_code on Wed Aug 06, 2008 6:15 am; edited 4 times in total |
|
| Back to top |
|
 |
shigeru AFC Space Explorer
Joined: 08 Jan 2008 Posts: 30
|
Posted: Thu Jan 24, 2008 2:49 pm Post subject: |
|
|
The copyright URLRequest doesn't work.
Always it accesses to AFC server...
I checked it via HTTP Live Headers of FireFox addon. |
|
| Back to top |
|
 |
deep2see AFC Space Ninja
Joined: 31 Jul 2007 Posts: 167
|
Posted: Thu Jan 24, 2008 3:36 pm Post subject: My Hybrid |
|
|
This is an example. Now it is possible to do such nice things thanks to Fine UMAP AS3! This is our Hybrid.Map tile from Mapinfo (Arcinfo, etc.) and Satellite Google.Thanks AFC. This is a revolutionary idea!!!
Here an example
http://new-tech.intway.info/test_kz.html
Vladimir,
Kazakhstan |
|
| Back to top |
|
 |
andrewl AFC Member
Joined: 23 Jan 2008 Posts: 5
|
Posted: Fri Jan 25, 2008 12:38 am Post subject: enable google terrain |
|
|
following the example above add this map type to your own settings file
| Code: | <mapType>
<name> terrain </name>
<textColor> 0x000000 </textColor>
<linkColor> 0x7777CC </linkColor>
<layer>
<minZoom> 0 </minZoom>
<maxZoom> 17 </maxZoom>
<url><![CDATA[ [server]/mt?n=[n]&v=[version]&x=[x]&y=[y]&zoom=[zoom] ]]></url>
<version> w2p.64 </version>
<servers>
<url> http://mt0.google.com </url>
<url> http://mt1.google.com </url>
<url> http://mt2.google.com </url>
<url> http://mt3.google.com </url>
</servers>
</layer>
</mapType>
|
add the custom provider and set the map type to "terrain"
this example is running locally so I use a relative path for the settings file
| Code: | import com.afcomponents.umap.core.UMap;
import com.afcomponents.umap.providers.google.GoogleProvider;
// create map & attach it to stage
var map:UMap = new UMap();
map.setSize(stage.stageWidth, stage.stageHeight);
this.addChild(map);
//define GoogleProvider with custom paths
var settings:URLRequest = new URLRequest("settings.xml?rand=" + Math.random());
var language:URLRequest = new URLRequest("http://maps.google.com/maps?file=api&v=2")
var copyright:URLRequest = new URLRequest("http://www.afcomponents.com/proxy/g_map_as3/copyright.php");
map.control.provider = new GoogleProvider(false, settings, language, copyright);
// set map type
map.setMapType("terrain"); |
enjoy! |
|
| Back to top |
|
 |
andrewl AFC Member
Joined: 23 Jan 2008 Posts: 5
|
Posted: Sun Jan 27, 2008 4:40 pm Post subject: Hybred sample with gis data |
|
|
| Valdamir, your example above is very interesting! I took a look at your settings.xml file and I don't see anything about a gis tile server. I looked at the http headers and I can see that you're loading your own tiles. How do you accomplish this? Is it an overlay? Can you please post some example code so others can try to load in their own tiles or GIS data in the same manner? Thanks. |
|
| Back to top |
|
 |
deep2see AFC Space Ninja
Joined: 31 Jul 2007 Posts: 167
|
Posted: Sun Jan 27, 2008 7:11 pm Post subject: |
|
|
andrewl !
Shortly AFC will publish the description of it overlay.
Here it is more clear, as it is realized
http://new-tech.intway.info/gog/serv.html
Thanks,
Vladimir |
|
| Back to top |
|
 |
rangelmp AFC Member
Joined: 19 Dec 2007 Posts: 4
|
Posted: Tue Jan 29, 2008 5:25 pm Post subject: overlay |
|
|
| deep2see when the overlay description comes? |
|
| Back to top |
|
 |
deep2see AFC Space Ninja
Joined: 31 Jul 2007 Posts: 167
|
Posted: Wed Jan 30, 2008 3:15 am Post subject: |
|
|
rangelmp !
These questions set AFC.
Dmitry and Andrey promise soon
Vladimir |
|
| Back to top |
|
 |
pbohny AFC Space Explorer
Joined: 16 Dec 2007 Posts: 47
|
Posted: Fri Feb 08, 2008 4:55 am Post subject: |
|
|
I would like to add my own maps, which at the moment are vector layers in Illustrator. I would really like to use them as swf's an somehow geo-reference them.How would we bring these into this whole context? When can we see more on this? Tutorials, descirptions? Do we need a copy of arcGIS 9.2. or are there other ways to do it?
Any guides to reading is appreciated |
|
| Back to top |
|
 |
deep2see AFC Space Ninja
Joined: 31 Jul 2007 Posts: 167
|
Posted: Fri Feb 08, 2008 6:54 am Post subject: |
|
|
Hi, pbohny!
Yes, universal Umap AFC has such opportunities.
And even it is more.
Here our small gallery.
[url]http://new-tech.intway.info/p1.htm[/url]
If you to us will send your small project for arcGIS x.x we shall try it we shall make as in
[url]http://new-tech.intway.info/test_kz.html [/url]
Mine email
new-techniq@narod.ru
Vladimir
Thanks and Best regards !!! |
|
| Back to top |
|
 |
pbohny AFC Space Explorer
Joined: 16 Dec 2007 Posts: 47
|
Posted: Fri Feb 08, 2008 2:51 pm Post subject: |
|
|
Vladimir
Thank you for the link. The question remains, what is the production process. What is necessary to provide own maps. (ArcGis Desktop? Server???)
Or even better, is it possible to exchange the boring polygons with swf overlays that behave just like they were map layers?
I appreciate your offer doing a test for (I will send you some stuff by mail soon) but we are in an evaluation process and need to make decisions based on things we understand and do ourselves. So it's important to see examples and understand exactly how they work and are processed.
There is something else that makes me curious. This morning I was able to see both, Google's and your content, now it seems that all Google content rendered with afcomponents is beeing blocked. Why is this? Can this be avoided? |
|
| Back to top |
|
 |
pbohny AFC Space Explorer
Joined: 16 Dec 2007 Posts: 47
|
Posted: Fri Feb 08, 2008 5:32 pm Post subject: No Google Data throuch afcomponents! |
|
|
That's what I get, no Google Data whatsoever. Am I beeing blocked?
How can I avoid this. |
|
| Back to top |
|
 |
deep2see AFC Space Ninja
Joined: 31 Jul 2007 Posts: 167
|
|
| Back to top |
|
 |
jatorre AFC Space Explorer
Joined: 06 Feb 2008 Posts: 19
|
Posted: Thu Feb 14, 2008 11:09 am Post subject: Overlaying simple PNG files |
|
|
Hi all,
I have been looking in both threads and I cant find an answer, so here it goes.
-Are you planning to support WMS as a Tile server? I think this should not be difficult, I have a working gmap with Javascript doing the same.
-Do you plan to create a very simple Provider just to overlay images over the map. I have seen implementation of this in Javascript. It seems pretty simple and is a very nice functionality
Thanks for the great work... it is really amazing...
Javier. |
|
| Back to top |
|
 |
dvs_code AFC Team

Joined: 09 May 2006 Posts: 2131
|
Posted: Thu Feb 14, 2008 11:19 am Post subject: |
|
|
What it is the WMS you have mentioned?
We will think of creating a simple Provider for you. _________________ Dmitry Stolyarov
AFC Team |
|
| Back to top |
|
 |
|