I'm just seeing X
Hi All,
I'm very new to Modest Maps so please pardon if my question is a bit silly. I'm using Flex Builder 3 to create the map. I've gone through the AC Transit Tutorial, which helps me a lot. But, the map is using an online services. I'm trying to use custom map here.
I'm sure I've put the map in the correct folder and link it from the MapProvider class. And, irregarless whether I use relative path i.e. assets/maps/ or absolute path i.e. http://localhost/assets/maps/, i'm still seeing X rather than the actual zoom able map.
And I think I've correctly set up the 3 points in the map for the Transformation to work. I've gone through
http://getsatisfaction.com/modestmaps...
Can someone help me on this? Been trying to figure this out myself for quite a while now. Very appreciate it.
The project file is located here
http://rapidshare.com/files/135981990...
I'm very new to Modest Maps so please pardon if my question is a bit silly. I'm using Flex Builder 3 to create the map. I've gone through the AC Transit Tutorial, which helps me a lot. But, the map is using an online services. I'm trying to use custom map here.
I'm sure I've put the map in the correct folder and link it from the MapProvider class. And, irregarless whether I use relative path i.e. assets/maps/ or absolute path i.e. http://localhost/assets/maps/, i'm still seeing X rather than the actual zoom able map.
And I think I've correctly set up the 3 points in the map for the Transformation to work. I've gone through
http://getsatisfaction.com/modestmaps...
Can someone help me on this? Been trying to figure this out myself for quite a while now. Very appreciate it.
The project file is located here
http://rapidshare.com/files/135981990...
1
person has this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
The best answers from the company
-
You need to set the center/zoom of your map to somewhere in Malaysia...
map.setCenterZoom(new Location(5.85,102.2),4);
Something like that.
The scrolling behaviour is sometimes a bit buggy with small maps, but once you're zoomed in it should be good.
The company and 1 other person say
this answers the question
-
Sorry, I should have said that I also commented out the transformation and projection lines in your AppMapProvider, so it's not as simple as I implied.
However I think the problem is with the values you're feeding into the calculator. Lat and Long in the calculator should be decimal degree values of latitude and longitude: between -90 and 90 for latitude and -180 and 180 for longitude. You can get these using something like http://getlatlon.com
e.g. the latitude and longitude for Kuala Lumpur would be something like 3.15021, 101.707703
Also, take care when entering x and y. The row is the y pixel value and the column is the x pixel value.
The company says
this answers the question
-
Inappropriate?A good tip here is to look at the network activity using Firefox and Firebug, or Safari's Activity window, or a proxy such as Charles. This should tell you what tiles your swf is trying to fetch, and you can make sure that the URLs look correct...
If they don't look right, then the specific wrongness will help us find the bug.
When I tried your project, I was loading URLs such as:
file:///Users/tom/Documents/Flex%20Builder%203/ModestMapTest/bin-debug/assets/maps/plus/TileGroup0/0-165-159.jpg
Which at least meant it was looking for things in the right folder, but the tile rows and columns seemed to be way off.
I added the following code after the map is initialized, and then the first tile shows up!
map.setCenterZoom(new Location(0,0),0);
If you add some zoom controls it should be possible to drag the map around too. -
Inappropriate?Yes, I suspected that's the problem but I dont know how to correct it. I've play around with the calculator but never able to get the correct tiles.
These are my mapping
Lat Long x y
464,000 735,000 464 735
2,144,000 6,712,000 2,144 6,712
5,360,000 1,370,000 5,360 1,370
which produces this mapping
var t:Transformation = new Transformation(0.057295779513082325, 0, 0,
0, 0.057295779513082325, -5.684341886080802e-14);
__projection = new LinearProjection(13, t);
Where did I do wrong?
From the trace function, I can see these path being passed
assets/maps/plus/0-0--1.jpg
assets/maps/plus/0-0--1.jpg
assets/maps/plus/0-0-0.jpg
assets/maps/plus/0-0-0.jpg
assets/maps/plus/0-0-1.jpg
assets/maps/plus/0-0--1.jpg
assets/maps/plus/0-0--1.jpg
assets/maps/plus/0-0-0.jpg
assets/maps/plus/0-0-1.jpg
assets/maps/plus/0-0-0.jpg
assets/maps/plus/0-0-1.jpg
assets/maps/plus/0-0-1.jpg
These are absolutely wrong because there's only 0-0-0.jpg
Just in case, the map is here http://rapidshare.com/files/136541513...
I’m frustrated
-
Inappropriate?Sorry, I should have said that I also commented out the transformation and projection lines in your AppMapProvider, so it's not as simple as I implied.
However I think the problem is with the values you're feeding into the calculator. Lat and Long in the calculator should be decimal degree values of latitude and longitude: between -90 and 90 for latitude and -180 and 180 for longitude. You can get these using something like http://getlatlon.com
e.g. the latitude and longitude for Kuala Lumpur would be something like 3.15021, 101.707703
Also, take care when entering x and y. The row is the y pixel value and the column is the x pixel value.
The company says
this answers the question
-
Inappropriate?If you're seeing requests for 0-0-0 and its immediate neighbors, that's fine even if they don't exist. As Tom says, check those lat, lon values!
-
Inappropriate?Hi again,
Will try to get the correct lon and lat.
On slightly different topic, how do i produce large image file? i'm trying to export some map in flash format (.fla) to image, but i couldnt export it if it is above 2880 pixels.
if i convert to illustrator format and try convert it to jpg, i will always have the out of memory error. my computer is running 2.4Ghz, 2Gb RAM
How do you produce such a big file
-
Inappropriate?Hi Guys,
I tried again based on the lat and log I obtained from getlatlon.com, and record it in the calculator and using the zoom based on the log computation. But it still seeing X. I'm out of idea why this is happening.
When I checked the log file, the application is searching for non-existing images and it is always from TileGroup0. I has no idea why this is happening. Besides, why does at time the images filename has double dash (--), instead of one. When I inspect the tiles generated by Zoomify, i dont see any double dash.
Can someone assist me on this?
127.0.0.1 - - [17/Aug/2008:01:08:46 +0800] "GET /modestmaps/assets/maps/kelantan/TileGroup0/0--41-4.jpg HTTP/1.1" 404 252
127.0.0.1 - - [17/Aug/2008:01:08:46 +0800] "GET /modestmaps/assets/maps/kelantan/TileGroup0/0--40-4.jpg HTTP/1.1" 404 252
127.0.0.1 - - [17/Aug/2008:01:08:46 +0800] "GET /modestmaps/assets/maps/kelantan/TileGroup0/0--39-5.jpg HTTP/1.1" 404 252
127.0.0.1 - - [17/Aug/2008:01:08:46 +0800] "GET /modestmaps/assets/maps/kelantan/TileGroup0/0--39-6.jpg HTTP/1.1" 404 252
127.0.0.1 - - [17/Aug/2008:01:08:46 +0800] "GET /modestmaps/assets/maps/kelantan/TileGroup0/0--42-4.jpg HTTP/1.1" 404 252
127.0.0.1 - - [17/Aug/2008:01:08:46 +0800] "GET /modestmaps/assets/maps/kelantan/TileGroup0/0--42-5.jpg HTTP/1.1" 404 252
127.0.0.1 - - [17/Aug/2008:01:08:46 +0800] "GET /modestmaps/assets/maps/kelantan/TileGroup0/0--43-6.jpg HTTP/1.1" 404 252
127.0.0.1 - - [17/Aug/2008:01:08:46 +0800] "GET /modestmaps/assets/maps/kelantan/TileGroup0/0--42-6.jpg HTTP/1.1" 404 252
127.0.0.1 - - [17/Aug/2008:01:08:47 +0800] "GET /modestmaps/assets/maps/kelantan/TileGroup0/0--41-3.jpg HTTP/1.1" 404 252
127.0.0.1 - - [17/Aug/2008:01:08:47 +0800] "GET /modestmaps/assets/maps/kelantan/TileGroup0/0--40-3.jpg HTTP/1.1" 404 252
127.0.0.1 - - [17/Aug/2008:01:08:47 +0800] "GET /modestmaps/assets/maps/kelantan/TileGroup0/0--39-3.jpg HTTP/1.1" 404 252
127.0.0.1 - - [17/Aug/2008:01:08:47 +0800] "GET /modestmaps/assets/maps/kelantan/TileGroup0/0--43-3.jpg HTTP/1.1" 404 252
127.0.0.1 - - [17/Aug/2008:01:08:47 +0800] "GET /modestmaps/assets/maps/kelantan/TileGroup0/0--42-3.jpg HTTP/1.1" 404 252
127.0.0.1 - - [17/Aug/2008:01:08:47 +0800] "GET /modestmaps/assets/maps/kelantan/TileGroup0/0--39-4.jpg HTTP/1.1" 404 252
127.0.0.1 - - [17/Aug/2008:01:08:47 +0800] "GET /modestmaps/assets/maps/kelantan/TileGroup0/0--41-5.jpg HTTP/1.1" 404 252
127.0.0.1 - - [17/Aug/2008:01:08:47 +0800] "GET /modestmaps/assets/maps/kelantan/TileGroup0/0--40-5.jpg HTTP/1.1" 404 252
127.0.0.1 - - [17/Aug/2008:01:08:47 +0800] "GET /modestmaps/assets/maps/kelantan/TileGroup0/0--41-6.jpg HTTP/1.1" 404 252
127.0.0.1 - - [17/Aug/2008:01:08:47 +0800] "GET /modestmaps/assets/maps/kelantan/TileGroup0/0--43-4.jpg HTTP/1.1" 404 252
127.0.0.1 - - [17/Aug/2008:01:08:47 +0800] "GET /modestmaps/assets/maps/kelantan/TileGroup0/0--40-6.jpg HTTP/1.1" 404 252
127.0.0.1 - - [17/Aug/2008:01:08:47 +0800] "GET /modestmaps/assets/maps/kelantan/TileGroup0/0--43-5.jpg HTTP/1.1" 404 252
I’m frustrated
-
Inappropriate?What you're seeing is the correct behaviour for the current version of Modest Maps.
The double dash is because it is asking for images with negative coordinates. At zoom level 0 there is only one tile: column 0, row 0, or 0-0-0.jpg
So the tile to the left of it will be 0--1-0.jpg and the tile above 0-0--1.jpg – of course these tiles don't exist, but the provider tries to load them anyway. It's not considered a bug because most of the time you'll zoom in somewhere inside tile 0-0-0 where all the tiles will exist.
It's only a problem if you're not seeing *any* valid tiles. Are you setting the initial center/zoom of your map to somewhere inside of the area with tiles? If not, it will default to Location(0,0) and not show anything. When I tried your code without specifying a projection in the provider, I could pan and zoom around the map just fine, but it did still show x's – I didn't think this was a problem.
If you want to stop it from trying to load tiles outside of the map, you'll need to override some of the functions in the map provider so that they don't load images that don't exist. You can also easily override paintError to not paint crosses, which is easier (but the 'bad' requests will still be made). -
Inappropriate?This is my code for AppMapProvider
package
{
import com.modestmaps.core.Coordinate;
import com.modestmaps.geo.LinearProjection;
import com.modestmaps.geo.Transformation;
import com.modestmaps.mapproviders.AbstractZoomifyMapProvider;
import com.modestmaps.mapproviders.IMapProvider;
public class AppMapProvider
extends AbstractZoomifyMapProvider
implements IMapProvider
{
public function AppMapProvider() {
super();
defineImageProperties("assets/maps/kelantan/", 17838, 25119);
var t:Transformation = new Transformation(756450.7712843401, 3644.341432354724, -1338060.2062059199,
-43447.93954501639, -721762.9126014732, 157382.51588980394);
__projection = new LinearProjection(15, t);
}
override public function toString():String {
return "APP_MAP_PROVIDER";
}
}
}
And this is the Index.mxml for loading the map and uses my AppMapProvider per above.
<?xml version="1.0" encoding="utf-8"?>
<mx:application>
<mx:script>
<![CDATA[
import com.modestmaps.extras.MapControls;
import com.modestmaps.geo.Location;
import mx.core.UIComponent;
import com.modestmaps.Map;
private var _map:Map;
private function init():void
{
var mc:MapControls = new MapControls(_map, true, true);
var ui:UIComponent = new UIComponent();
ui.addChild(mc);
mapCanvas.addChild(ui);
_map.setCenter(new Location(0,0));
}
private function mapCanvasInit():void
{
// create map
_map = new Map(mapCanvas.width, mapCanvas.height, true, new AppMapProvider());
// add to map canvas
var ui:UIComponent = new UIComponent();
ui.addChild(_map);
mapCanvas.addChild(ui);
}
]>
</mx:script>
<mx:canvas height="100%" width="100%">
</mx:canvas>
</mx:application>
This is the mapping that I've used.
I’m frustrated
-
Inappropriate?You need to set the center/zoom of your map to somewhere in Malaysia...
map.setCenterZoom(new Location(5.85,102.2),4);
Something like that.
The scrolling behaviour is sometimes a bit buggy with small maps, but once you're zoomed in it should be good.
The company and 1 other person say
this answers the question
-
Inappropriate?You might have a problem with the area of the mapCanvas that will pass on mouse events to the map. I don't know enough about flex to debug this one, but in my test version the map was only receiving mouse events when it was inside a 640x480 box in the top left of the canvas. Just wanted to let you know.
-
Inappropriate?The solution works. I though there was a problem with my transformation, didn't realized i have to manually set the center. Nevertheless, thanks RandomEtc :)
Now, my journey continues. on with markers!
I’m happy
1 person says
this answers the question
Loading Profile...




EMPLOYEE
EMPLOYEE
