chellymehdi / vopenlayers

Automatically exported from code.google.com/p/vopenlayers
0 stars 0 forks source link

'null' is null or not an object and 'google' is undefined error when using OpenStreetMapLayer and GoogleStreetMapLayer #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?
'null' is null or not an object and 'google' is undefined error 
What version of the product are you using? On what operating system?
Windows xp operatyings ystem. I am using 0.5.2 version. I generated the 
widgetset client code in eclipse using vaadin-eclipse plugin.

Please provide any additional information below.
I have city and street name with me. Using openlayers addon of vaadin, i need 
to show the street map with marker for that city and street.

Original issue reported on code.google.com by santoshi...@gmail.com on 29 Mar 2011 at 11:14

GoogleCodeExporter commented 9 years ago
I am using IE8 which gives js error and in FF3 it shows blank page.

Original comment by santoshi...@gmail.com on 29 Mar 2011 at 11:15

GoogleCodeExporter commented 9 years ago
Hi,

Could you make sure that the latest version (0.5.3) still has this issue? IMO 
0.5.2 shouldn't neither. 

Remember to recompile the widgetset. I saw some liferay references in your test 
code. It happens easily in Liferay development that the client side engine does 
not get the latest client side code.

Original comment by matti.ta...@gmail.com on 29 Mar 2011 at 6:17

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hi Matti,
Actually,my  real time project environment is netbeans+maven+liferay. But for 
initially when started using openlayers wrapper addon ,i used 
eclipse+maven+jetty as environment and  vaadin plugin for eclipse helps a lot 
in compiling the widgetset inside the addon.So i used to compile the widgetset 
in eclipse and write some code following 
(http://code.google.com/p/vopenlayers/source/browse/trunk/src/test/java/org/vaad
in/vol/demo/VolApplication.java#53) and test it. If it works ok, then i copy 
the widgetset folder and gwt.xml file and java code to the netbeans environment 
which is my actual project environment where i have to generate map.

As told by you, i switched to latest versio of openlayers which is 0.5.3 and 
compiled the widgetset.Then i used the same code as in 
http://code.google.com/p/vopenlayers/source/browse/trunk/src/test/java/org/vaadi
n/vol/demo/VolApplication.java#53 url inside my vaadin application class.I have 
attached here the screenshots of the map which i got when i tested 
createTestMap(window),getMapIssue1() and getMapIssue2() methods.I have kept the 
image names same as the function which i used to generate map.Only for 
getMapIssue2() which uses WebMapServiceLayer, some map got displayed. Otherwise 
for other two which uses OpenStreetMapLayer and GoogleStreetMapLayer, it shown 
some js error which i had reported before.

My requirement is that, i have street address and city name with me, i need to 
generate may be street map and show a marker at that particular street which i 
have details.So can you suggest me which layer i should use and some sample 
code for that.
I have also attached a image with name RequiredMap.jpeg to show you which kind 
of map i need to generate using openlayers addon.

Also, i have few questions on this addon
(1)There are so many layers available. But is there any documentation present 
to know when to use which layer.
(2)For my requirement which layer i should use
(3)WebMapServiceLayer set some uri which is different in differnt examples 
given by you. Like one case http://vmap0.tiles.osgeo.org/wms/vmap0 and another 
case http://www2.dmsolutions.ca/cgi-bin/mswms_gmap. What are these urls point 
to? Do i also need a url like this or can i use same?
(4)If i want to use openstreetmap as they are free, how to use them. I think 
openlayers addon implements openstreet map.

Please help me to generate a map like mentioned in the RequiredMap.jpeg file.

Original comment by santoshi...@gmail.com on 30 Mar 2011 at 7:52

GoogleCodeExporter commented 9 years ago
Hi,

If you want to use OpenStreetMap or Googles map layer, you need to add their 
javascripts additions to the host html page somehow. I may depend on your 
hosting setup which is the best method to do this, but one solution is to add 
them via GWT module (aka widgetset) like in the test application in the wrapper 
project:

http://code.google.com/p/vopenlayers/source/browse/trunk/src/test/java/org/vaadi
n/vol/demo/VolExampleAppWidgetset.gwt.xml#10

If you wish to use your own base map (as it looks based on the 
RequiredMap.jpg), you need a WMS server and use the WMS layer as a base layer. 
Those url's in examples are just some public WMS addresses that are used for 
testing. I wouldn't suggest to use them in production environment.

I enhanced the javadocs in
http://code.google.com/p/vopenlayers/source/detail?r=22

cheers,
matti

Original comment by matti.ta...@gmail.com on 30 Mar 2011 at 9:51

GoogleCodeExporter commented 9 years ago
Hi,
The requirement is that RequiredMap.jpg uses own base map . But my job is to 
replace that with OpenStreetMap as the map is free using openlayer wrapper 
addon of vaadin as we use vaadin framework for ui devlopment and generate a 
same kind of map as RequiredMap.jpg.So i think i have to use OpenStreetMapLayer 
for this?

Right now i am using eclipse+maven+pom.xml setup. I have dependency to 
openlayers-wrapper(version 0.5.3) and gwt-openlayers-client(version 0.5) in my 
pom.xml.When i compile the widgetset, it generates 
OpenlayersprojectWidgetset.gwt xml file  and a set of html,png and js files 
inside /VAADIN/widgetsets directory.I have attached them here.

I am using getMapIssue1() method inside my application class as that uses 
OpenStreetMapLayer and MarkerLayer. As i have to also show the street address 
as markup. So please let me know what kind of changes i need to make to my code 
for generating OpenStreetMap which is similar to RequiredMap.jpg.

Thanks in advance.

Original comment by santoshi...@gmail.com on 31 Mar 2011 at 7:59

GoogleCodeExporter commented 9 years ago
In addition to the above, if i add 
http://www.openstreetmap.org/openlayers/OpenStreetMap.js inside my gwt xml file 
which i have attached above, then when browsing project in firefox3, i can see 
the following error in firebug for openstrretmap.js file

<p>You don't have permission to access /openlayers/OpenStreetMap.js
7on this server.</p>
8<hr>
9<address>Apache/2.2.14 (Ubuntu) Server at www.openstreetmap.org Port 
80</address>
10</body></html>

Original comment by santoshi...@gmail.com on 31 Mar 2011 at 8:56