Advanced Flash Components
Search!
Search!
Home >  Forum
  SearchSearch   
UMap Providers
Goto page 1, 2, 3, 4  Next
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.     Forum Index -> UMap ActionScript 3.0
View previous topic :: View next topic  
Author Message
dvs_code
AFC Team


Joined: 09 May 2006
Posts: 2131

PostPosted: Thu Jan 24, 2008 8:53 am    Post subject: UMap Providers Reply with quote

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
View user's profile Send private message Visit poster's website
shigeru
AFC Space Explorer


Joined: 08 Jan 2008
Posts: 30

PostPosted: Thu Jan 24, 2008 2:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
deep2see
AFC Space Ninja


Joined: 31 Jul 2007
Posts: 167

PostPosted: Thu Jan 24, 2008 3:36 pm    Post subject: My Hybrid Reply with quote

Very Happy Very Happy Exclamation Exclamation
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
View user's profile Send private message
andrewl
AFC Member


Joined: 23 Jan 2008
Posts: 5

PostPosted: Fri Jan 25, 2008 12:38 am    Post subject: enable google terrain Reply with quote

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
View user's profile Send private message
andrewl
AFC Member


Joined: 23 Jan 2008
Posts: 5

PostPosted: Sun Jan 27, 2008 4:40 pm    Post subject: Hybred sample with gis data Reply with quote

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
View user's profile Send private message
deep2see
AFC Space Ninja


Joined: 31 Jul 2007
Posts: 167

PostPosted: Sun Jan 27, 2008 7:11 pm    Post subject: Reply with quote

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
View user's profile Send private message
rangelmp
AFC Member


Joined: 19 Dec 2007
Posts: 4

PostPosted: Tue Jan 29, 2008 5:25 pm    Post subject: overlay Reply with quote

deep2see when the overlay description comes?
Back to top
View user's profile Send private message
deep2see
AFC Space Ninja


Joined: 31 Jul 2007
Posts: 167

PostPosted: Wed Jan 30, 2008 3:15 am    Post subject: Reply with quote

rangelmp !
These questions set AFC.
Dmitry and Andrey promise soon
Vladimir
Back to top
View user's profile Send private message
pbohny
AFC Space Explorer


Joined: 16 Dec 2007
Posts: 47

PostPosted: Fri Feb 08, 2008 4:55 am    Post subject: Reply with quote

deep2see wrote:
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


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
View user's profile Send private message
deep2see
AFC Space Ninja


Joined: 31 Jul 2007
Posts: 167

PostPosted: Fri Feb 08, 2008 6:54 am    Post subject: Reply with quote

Back to top
View user's profile Send private message
pbohny
AFC Space Explorer


Joined: 16 Dec 2007
Posts: 47

PostPosted: Fri Feb 08, 2008 2:51 pm    Post subject: Reply with quote

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
View user's profile Send private message
pbohny
AFC Space Explorer


Joined: 16 Dec 2007
Posts: 47

PostPosted: Fri Feb 08, 2008 5:32 pm    Post subject: No Google Data throuch afcomponents! Reply with quote




That's what I get, no Google Data whatsoever. Am I beeing blocked?

How can I avoid this.
Back to top
View user's profile Send private message
deep2see
AFC Space Ninja


Joined: 31 Jul 2007
Posts: 167

PostPosted: Sat Feb 09, 2008 6:24 am    Post subject: vector maps Reply with quote

Very Happy Hi, pbohny
Andrey has answered all questions here
http://www.afcomponents.com/forum/viewtopic.php?t=2480
Example for vector maps Arc Gis here:
http://new-tech.intway.info/p1.htm
I showing on Action Script
Too most for Umap AS3
Thanks and Best regards !
Vladimir
Back to top
View user's profile Send private message
jatorre
AFC Space Explorer


Joined: 06 Feb 2008
Posts: 19

PostPosted: Thu Feb 14, 2008 11:09 am    Post subject: Overlaying simple PNG files Reply with quote

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 Smile

Thanks for the great work... it is really amazing...

Javier.
Back to top
View user's profile Send private message
dvs_code
AFC Team


Joined: 09 May 2006
Posts: 2131

PostPosted: Thu Feb 14, 2008 11:19 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.     Forum Index -> UMap ActionScript 3.0 All times are GMT
Goto page 1, 2, 3, 4  Next
Page 1 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group