Giter VIP home page Giter VIP logo

Comments (10)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024
Possibly related to issue 39. 

Original comment by [email protected] on 4 Feb 2008 at 7:46

from gwt-google-apis.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024
Google-web-toolkit group reference:

http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/80729d407
91eca39/b8a6432e8a23ab38?lnk=gst&q=Feedback+requested%3A+Google+API+Library+supp
ort+for+Google+Maps+and+AJAX+Search#b8a6432e8a23ab38

Here's some sample code from user COCGIS that causes the problem:


 I tried a simpler example, a customized tile layer, started from the
js sample at 
http://www.google.com/apis/maps/documentation/overlays.html#Tile_Laye....
but I ran into problem with MapType

  public void onModuleLoad() {

    final MapWidget map= new MapWidget(new LatLng(35.249208,
-80.843099), 10);
    map.setSize("500px", "500px");
    CopyrightCollection myCopyright=new CopyrightCollection("");
    myCopyright.addCopyright(new Copyright(1,new LatLngBounds(new
LatLng(34,-81),new LatLng(36,-79)),10,""));
    TileLayer tileLayer = new TileLayer(myCopyright,10,18){
        public boolean isPng(){return true;}
        public double getOpacity(){return 1.0;}
        public String getTileURL(Point tile, int zoomLevel){
              return "http://www.google.com/apis/maps/documentation/
examples/include/tile_crosshairs.png";
        }
     };
    //TileLayerOverlay layerOverlay=new TileLayerOverlay(tileLayer);
    //map.addOverlay(layerOverlay);
    MapType mapType=new MapType(new TileLayer[]{tileLayer},new
MercatorProjection(20),"MyMap");
    map.addMapType(mapType);
    map.addControl(new MapTypeControl());
    RootPanel.get().add(map);//

  }

The tile layer works fine as a tile overlay on top of normal maps,
however,
when I click the "MyMap" type, I got the following error:
com.google.gwt.dev.shell.HostedModeException: Calling method
'createPeer': JS object of type number, expected
com.google.gwt.core.client.JavaScriptObject
        at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:114)
        at
com.google.gwt.dev.shell.ie.SwtOleGlue.convertVariantsToObjects(SwtOleGlue.java:
57)
        at
com.google.gwt.dev.shell.ie.IDispatchImpl.callMethod(IDispatchImpl.java:
119)
        at
com.google.gwt.dev.shell.ie.IDispatchProxy.invoke(IDispatchProxy.java:
150)

--


1. The Projection.tileCheckRange method's signature changed from the
js API, and I don't think it is because of naming convention as in the
case of getTileURL. The last parameter tilesize is
com.google.gwt.maps.client.geom.Size instead of int. However, in the
runtime, what's been passed in by the js API is actually a number
(256), causing the errors. (Calling method 'createPeer': JS object of
type number, expected com.google.gwt.core.client.JavaScriptObject).

2. In the js API, a typical use of GProjection class is call method
fromLatLngToPixel etc in overlay or control class to position stuff on
top the map, but com.google.gwt.maps.client.geom.MercatorProjection
has those two method as protected, so you can not really have some
code like:

   Projection prj=new MercatorProjection(20);
   Point p=prj.fromLatLngToPixel(new LatLng(40, -80));

 which is supposed to be a "correct" use. Any special reason why those
methods are protected? They are meant to be called. 


Original comment by [email protected] on 14 Feb 2008 at 4:53

from gwt-google-apis.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024
Added patches that fix the original reported issue and issues #1 & #2 later in 
the
groups thread. 

Original comment by [email protected] on 15 Feb 2008 at 4:03

  • Changed state: ReviewPending

Attachments:

from gwt-google-apis.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024
The projection patch also addresses issue #58

Original comment by [email protected] on 16 Feb 2008 at 10:24

  • Added labels: API-Maps, Milestone-1_1_RC

from gwt-google-apis.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024
galgwt-Projection-fixups-issue29-r120.patch committed as r124.

Original comment by [email protected] on 20 Feb 2008 at 3:35

from gwt-google-apis.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024
galgwt-custom-MapType-issue29-r120.patch committed as r125.

Original comment by [email protected] on 20 Feb 2008 at 3:38

  • Changed state: FixedNotReleased

from gwt-google-apis.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024

Original comment by [email protected] on 9 Jun 2008 at 11:30

from gwt-google-apis.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024

Original comment by [email protected] on 13 Oct 2008 at 8:54

  • Added labels: Milestone-1_0_RC

from gwt-google-apis.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024

Original comment by [email protected] on 11 Dec 2008 at 3:08

  • Changed state: Fixed

from gwt-google-apis.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024

Original comment by [email protected] on 21 Dec 2009 at 1:57

from gwt-google-apis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.