GMZoomLevelMarkers error as SUAllTest link

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

GMZoomLevelMarkers error as SUAllTest link

dario trussardi
Hi,

some week ago i write on seaside forum  about a problem relative to display GMZoomLevelMarkers as SUComponent link.


For now i solve the problem changed the script ( don't consider function ),

function setupOfficeMarkers() { allmarkers.length = 0; for (var i in officeLayer) { var layer = officeLayer[i]; var markers = []; for (var j in layer["places"]) { if ( typeof layer["places"][j] !== "function" ){ var place = layer["places"][j]; var icon = getIcon(place["icon"]); var title = place["name"]; var ancor = place["ancor"]; var posn = new GLatLng(place["posn"][0], place["posn"][1]); var marker = createMarker(posn,title,icon,ancor); markers.push(marker); allmarkers.push(marker); } mgr.addMarkers(markers, layer["zoom"][0], layer["zoom"][1]); } } mgr.refresh(); }

 but isn't elegant solution.


The problem:

you can found the problem adding a new entry to SUAllTest initialize method:

add: 'Effects' -> (Array with: 'Effects' -> SUEffectsTest new with: 'Toggles' -> SUTogglesTest new with: 'Morph' -> SUMorphTest new);

add: 'testDTR' -> (Array with: 'test' -> GMZoomLevelMarkers new ); yourself.


Now when you open this link  the markers d'ont display.

If you use the browser inspector and exploring the 'officeLayer' data you found:

places: Array
zoom: Array

0: 0
1: 3
_each: function forEach() {
_reverse: function reverse() {
........
.....
....

Where other the data, you found the relative function.

And this is the error, because the script d'ont 'understand' it.


From  Lukas input i  read <http://www.prototypejs.org/learn/json>.

But i'm confusing ( and my javascript know is very limited )

The system add some function ( _each _reverse all .....   ) to the data:

  1. placesArray
  2. zoomArray
    1. 00
    2. 10
    3. _eachfunction forEach() {
    4. _reversefunction reverse() {
    5. allfunction (C, B) {C=C?C.bind(B):Pro.....
    6. anyfunction (C, B) {C=C?C.bind(B):P...........
    7. clear: ...........
    8. ..........

but i don't understand where the 'system' do it and where i need do change.
 
I need to create data with other informations?

I need to set parameter ?

I can consider the create data right ?

It's a browser data interpreter  problem ?

Do you have idea where .......   

Any pointers would be greatly appreciated !

Thanks,

Dario

Reply | Threaded
Open this post in threaded view
|

Re: GMZoomLevelMarkers error as SUAllTest link

Dale
Dario,

I'm not proficient in javascript myself so the problem that you are trying describe isn't clear to me. Specifically, I don't know which 'system' the methods need to be added to and which methods are not 'understood' ... perhaps some stack traces would help me understand the problem better ...

Is the a problem that is unique to GemStone?

Dale
----- "Dario Trussardi" <[hidden email]> wrote:

| Hi,
|
| some week ago i write on seaside forum  about a problem relative to
| display GMZoomLevelMarkers as SUComponent link.
|
|
| For now i solve the problem changed the script ( don't consider
| function ),
|
| function setupOfficeMarkers() {
| allmarkers.length = 0;
| for (var i in officeLayer) {
| var layer = officeLayer[i];
| var markers = [];
| for (var j in layer["places"]) {
| if (  typeof layer["places"][j] !==  "function"  ){
| var place = layer["places"][j];
| var icon = getIcon(place["icon"]);
| var title = place["name"];
| var ancor = place["ancor"];
| var posn = new GLatLng(place["posn"][0], place["posn"][1]);
| var marker = createMarker(posn,title,icon,ancor);
| markers.push(marker);
| allmarkers.push(marker);
| }
| mgr.addMarkers(markers, layer["zoom"][0], layer["zoom"][1]);
|  }
| }
| mgr.refresh();
| }
|
|  but isn't elegant solution.
|
|
| The problem:
|
| you can found the problem adding a new entry to SUAllTest initialize
| method:
|
| add: 'Effects' -> (Array
| with: 'Effects' -> SUEffectsTest new
| with: 'Toggles' -> SUTogglesTest new
| with: 'Morph' -> SUMorphTest new);
|
|
| add: 'testDTR' -> (Array
| with: 'test' -> GMZoomLevelMarkers new );
|   yourself.
|
|
| Now when you open this link  the markers d'ont display.
|
| If you use the browser inspector and exploring the 'officeLayer' data
| you found:
|
| places: Array
| zoom: Array
|
| 0: 0
| 1: 3
| _each: function forEach() {
| _reverse: function reverse() {
| ........
| .....
| ....
|
| Where other the data, you found the relative function.
|
| And this is the error, because the script d'ont 'understand' it.
|
|
| From  Lukas input i  read <http://www.prototypejs.org/learn/json>.
|
| But i'm confusing ( and my javascript know is very limited )
|
| The system add some function ( _each _reverse all .....   ) to the
| data:
|
|
| places: Array
| zoom: Array
| 0: 0
| 1: 0
| _each: function forEach() {
| _reverse: function reverse() {
| all: function (C, B) {C=C?C.bind(B):Pro.....
| any: function (C, B) {C=C?C.bind(B):P...........
| clear: ...........
| ..........
|
| but i don't understand where the 'system' do it and where i need do
| change.
|  
| I need to create data with other informations?
|
| I need to set parameter ?
|
| I can consider the create data right ?
|
| It's a browser data interpreter  problem ?
|
| Do you have idea where .......  
|
| Any pointers would be greatly appreciated !
|
| Thanks,
|
| Dario
Reply | Threaded
Open this post in threaded view
|

Re: GMZoomLevelMarkers error as SUAllTest link

dario trussardi
Dale,

> I'm not proficient in javascript myself so the problem that you are trying describe isn't clear to me.

> Specifically, I don't know which 'system' the methods need to be added to and which methods are not 'understood'

With 'system' i talk about to all the components for manage a web request. ( Browser - javascript - seaside - ............. ) .

For now i d'ont have idea what specific component produce this problem.

> ... perhaps some stack traces would help me understand the problem better ..

I don't have any  error, but the example d'ont work fine.

> .
>
> Is the a problem that is unique to GemStone?
.
No, i load GoogleMaps-jgf.23 into Pharo and i have the same fault work .


>
> Dale
> ----- "Dario Trussardi" <[hidden email]> wrote:
>
> | Hi,
> |
> | some week ago i write on seaside forum  about a problem relative to
> | display GMZoomLevelMarkers as SUComponent link.
> |
> |
> | For now i solve the problem changed the script ( don't consider
> | function ),
> |
> | function setupOfficeMarkers() {
> | allmarkers.length = 0;
> | for (var i in officeLayer) {
> | var layer = officeLayer[i];
> | var markers = [];
> | for (var j in layer["places"]) {
> | if (  typeof layer["places"][j] !==  "function"  ){
> | var place = layer["places"][j];
> | var icon = getIcon(place["icon"]);
> | var title = place["name"];
> | var ancor = place["ancor"];
> | var posn = new GLatLng(place["posn"][0], place["posn"][1]);
> | var marker = createMarker(posn,title,icon,ancor);
> | markers.push(marker);
> | allmarkers.push(marker);
> | }
> | mgr.addMarkers(markers, layer["zoom"][0], layer["zoom"][1]);
> |  }
> | }
> | mgr.refresh();
> | }
> |
> |  but isn't elegant solution.
> |
> |

You can replicate the environment with:

> | The problem:
> |
> | you can found the problem adding a new entry to SUAllTest initialize
> | method:
> |
> | add: 'Effects' -> (Array
> | with: 'Effects' -> SUEffectsTest new
> | with: 'Toggles' -> SUTogglesTest new
> | with: 'Morph' -> SUMorphTest new);
> |
> |
> | add: 'testDTR' -> (Array
> | with: 'test' -> GMZoomLevelMarkers new );
> |   yourself.
> |
> |
> | Now when you open this link  the markers d'ont display.
> |
> | If you use the browser inspector and exploring the 'officeLayer' data
> | you found:
> |
> | places: Array
> | zoom: Array
> |
> | 0: 0
> | 1: 3
> | _each: function forEach() {
> | _reverse: function reverse() {
> | ........
> | .....
> | ....
> |
> | Where other the data, you found the relative function.
> |
> | And this is the error, because the script d'ont 'understand' it.
> |
> |
> | From  Lukas input i  read <http://www.prototypejs.org/learn/json>.
> |
> | But i'm confusing ( and my javascript know is very limited )
> |
> | The system add some function ( _each _reverse all .....   ) to the
> | data:
> |
> |
> | places: Array
> | zoom: Array
> | 0: 0
> | 1: 0
> | _each: function forEach() {
> | _reverse: function reverse() {
> | all: function (C, B) {C=C?C.bind(B):Pro.....
> | any: function (C, B) {C=C?C.bind(B):P...........
> | clear: ...........
> | ..........
> |
> | but i don't understand where the 'system' do it and where i need do
> | change.
> |  
> | I need to create data with other informations?
> |
> | I need to set parameter ?
> |
> | I can consider the create data right ?
> |
> | It's a browser data interpreter  problem ?
> |
> | Do you have idea where .......  
> |
> | Any pointers would be greatly appreciated !
> |

Thanks,

                Dario