Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Ciao, sto creando una pagina in php con una mappa ... in OpenLayers Examples ho trovato due interessanti esempi:

Il mio problema è che non riesco ad integrare i due esempi...

dal primo:

echo" 
        ll = new OpenLayers.LonLat($lng,$lat).transform( 
            new OpenLayers.Projection('EPSG:4326'), new OpenLayers.Projection('EPSG:900913') 
        ); 
        popupClass = OpenLayers.Popup.Anchored; 
        popupContentHTML = '$T'; 
        addMarker(ll, popupClass, popupContentHTML, false, true); 

dal secondo:

echo" 
        ll = new OpenLayers.LonLat($lng,$lat).transform( 
            new OpenLayers.Projection('EPSG:4326'), new OpenLayers.Projection('EPSG:900913') 
        ); 
        var size = new OpenLayers.Size(50,50); 
        var offset = new OpenLayers.Pixel(-(size.w/2), -size.h); 
        var icon = new OpenLayers.Icon('{$row['enclosure']}',size,offset); 
        markers.addMarker( 
            new OpenLayers.Marker( 
                (ll 
                ),icon 
            ) 
        ); 
"; 

Ho notato che nel primo addMarker richiama una funzione, che sembra simile a markers.addMarker

... sinceramente non so dove mettere ", icon" nel primo o nella funzione che richiama?

EDIT - Translation to English (Tradotto in inglese)

Hello, I am creating a php page with a map ... in OpenLayers Examples I found two interesting examples:

• Example showing how to use different types of poupup (http://openlayers.org/dev/examples/popupMatrix.html)

• example to insert custom icons (http://openlayers.org/dev/examples/markers.html)

My problem is that I can not integrate the two examples ...

the first:

echo" 
            ll = new OpenLayers.LonLat($lng,$lat).transform( 
                new OpenLayers.Projection('EPSG:4326'), new OpenLayers.Projection('EPSG:900913') 
            ); 
            popupClass = OpenLayers.Popup.Anchored; 
            popupContentHTML = '$T'; 
            addMarker(ll, popupClass, popupContentHTML, false, true); 

The Second:

echo" 
        ll = new OpenLayers.LonLat($lng,$lat).transform( 
            new OpenLayers.Projection('EPSG:4326'), new OpenLayers.Projection('EPSG:900913') 
        ); 
        var size = new OpenLayers.Size(50,50); 
        var offset = new OpenLayers.Pixel(-(size.w/2), -size.h); 
        var icon = new OpenLayers.Icon('{$row['enclosure']}',size,offset); 
        markers.addMarker( 
            new OpenLayers.Marker( 
                (ll 
                ),icon 
            ) 
        ); 
"; 

I noticed that in the first addMarker calls a function, which looks similar to markers.addMarker

... I honestly do not know where to put "icon" in the first or in the function calling?

share|improve this question
    
Posts here are expected to be in English. Can you at least use Google Translate and then other people can try and correct it. Otherwise your audience will be a very small fraction of GIS Stack Exchange –  Stev_k Sep 3 '12 at 8:36
    
ho fatto una demo: http://78.134.3.20:81/simple_page/openlayers_001/php/fm_prima.php Ho messo tre icone e nella pagina, ma anche semplicemente facendo view source in Chrome, si può capire... Pj –  pjhooker Sep 3 '12 at 18:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.